mirror of
https://github.com/nginx/nginx.git
synced 2025-06-07 01:12:40 +08:00
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.
This commit is contained in:
parent
3ffbf84a5e
commit
51df7912c4
@ -683,14 +683,14 @@ ngx_epoll_notify(ngx_event_handler_pt handler)
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user