]> git.kaiwu.me - nginx.git/commit
Added shmtx interface to forcibly unlock mutexes.
authorMaxim Dounin <mdounin@mdounin.ru>
Wed, 23 Nov 2011 13:55:38 +0000 (13:55 +0000)
committerMaxim Dounin <mdounin@mdounin.ru>
Wed, 23 Nov 2011 13:55:38 +0000 (13:55 +0000)
commit91ecc8f43c42c677cd7b2230a68f19b64b649ba5
treef05df203ee000dde0ce2297cea01a6ef663513d4
parent1e5f2391704c252fcd01f798a18aa8558376cb1a
Added shmtx interface to forcibly unlock mutexes.

It is currently used from master process on abnormal worker termination to
unlock accept mutex (unlocking of accept mutex was broken in 1.0.2).  It is
expected to be used in the future to unlock other mutexes as well.

Shared mutex code was rewritten to make this possible in a safe way, i.e.
with a check if lock was actually held by the exited process.  We again use
pid to lock mutex, and use separate atomic variable for a count of processes
waiting in sem_wait().
src/core/ngx_cycle.c
src/core/ngx_shmtx.c
src/core/ngx_shmtx.h
src/core/ngx_slab.h
src/event/ngx_event.c
src/os/unix/ngx_process.c