Mercurial > hg > nginx
changeset 6061:953ef81705e1
Events: fixed possible crash on start or reload.
The main thread could wake up and start processing the notify event
before the handler was set.
author | Valentin Bartenev <vbart@nginx.com> |
---|---|
date | Fri, 27 Mar 2015 21:19:20 +0300 |
parents | 3d4730eada9c |
children | 173561dfd567 |
files | src/event/modules/ngx_epoll_module.c |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/event/modules/ngx_epoll_module.c Fri Mar 27 19:57:15 2015 +0300 +++ b/src/event/modules/ngx_epoll_module.c Fri Mar 27 21:19:20 2015 +0300 @@ -683,14 +683,14 @@ { static uint64_t inc = 1; + notify_event.data = handler; + if ((size_t) write(notify_fd, &inc, sizeof(uint64_t)) != sizeof(uint64_t)) { ngx_log_error(NGX_LOG_ALERT, notify_event.log, ngx_errno, "write() to eventfd %d failed", notify_fd); return NGX_ERROR; } - notify_event.data = handler; - return NGX_OK; }