aboutsummaryrefslogtreecommitdiff
path: root/src/os/unix/ngx_linux_aio_read.c
diff options
context:
space:
mode:
authorRoman Arutyunyan <arut@nginx.com>2015-02-04 16:22:43 +0300
committerRoman Arutyunyan <arut@nginx.com>2015-02-04 16:22:43 +0300
commit2bae4205abd1583a5f3e2dfdc3174c1ef0c3828d (patch)
tree7d0ba5fc446c4e174e7bbead2f4cae063d26e507 /src/os/unix/ngx_linux_aio_read.c
parentcae1b5d63a6da625cf5c3606d989a7fe2ebfbd4c (diff)
downloadnginx-2bae4205abd1583a5f3e2dfdc3174c1ef0c3828d.tar.gz
nginx-2bae4205abd1583a5f3e2dfdc3174c1ef0c3828d.zip
Core: fixed a race resulting in extra sem_post()'s.
The mtx->wait counter was not decremented if we were able to obtain the lock right after incrementing it. This resulted in unneeded sem_post() calls, eventually leading to EOVERFLOW errors being logged, "sem_post() failed while wake shmtx (75: Value too large for defined data type)". To close the race, mtx->wait is now decremented if we obtain the lock right after incrementing it in ngx_shmtx_lock(). The result can become -1 if a concurrent ngx_shmtx_unlock() decrements mtx->wait before the added code does. However, that only leads to one extra iteration in the next call of ngx_shmtx_lock().
Diffstat (limited to 'src/os/unix/ngx_linux_aio_read.c')
0 files changed, 0 insertions, 0 deletions