Mercurial > hg > nginx-quic
comparison src/event/ngx_event_mutex.c @ 1:d220029ac7f3
nginx-0.0.1-2002-08-15-21:20:26 import
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Thu, 15 Aug 2002 17:20:26 +0000 |
parents | |
children | d4e65d74db9f |
comparison
equal
deleted
inserted
replaced
0:4eff17414a43 | 1:d220029ac7f3 |
---|---|
1 | |
2 spinlock_max depend on CPU number and mutex type. | |
3 1 CPU 1 | |
4 ngx_malloc_mutex 1000 ? | |
5 | |
6 | |
7 int ngx_event_mutex_trylock(ngx_mutex_t *mtx) | |
8 { | |
9 for(i = mtx->spinlock_max; i; i--) | |
10 if (trylock(mtx->lock)) | |
11 return 1; | |
12 | |
13 return 0; | |
14 } |