Sign in
nginx
/
nginx
/
5c8c52f858c0112e9200ed1c4798a89e6c366bf2
/
.
/
src
/
event
/
ngx_event_mutex.c
blob: 5a9542b0612bf1d5d6c5051f2183ff2bc8f32181 [
file
] [
log
] [
blame
]
spinlock_max depend on CPU number and mutex type
.
1
CPU
1
ngx_malloc_mutex
1000
?
int
ngx_event_mutex_trylock
(
ngx_mutex_t
*
mtx
)
{
for
(
i
=
mtx
->
spinlock_max
;
i
;
i
--)
if
(
trylock
(
mtx
->
lock
))
return
1
;
return
0
;
}