vendor/nginx/src/event/modules/ngx_rtsig_module.c in nginxtra-1.6.3.9 vs vendor/nginx/src/event/modules/ngx_rtsig_module.c in nginxtra-1.8.0.9

- old
+ new

@@ -128,11 +128,11 @@ NULL, /* delete an event */ NULL, /* enable an event */ NULL, /* disable an event */ ngx_rtsig_add_connection, /* add an connection */ ngx_rtsig_del_connection, /* delete an connection */ - NULL, /* process the changes */ + NULL, /* trigger a notify */ ngx_rtsig_process_events, /* process the events */ ngx_rtsig_init, /* init the events */ ngx_rtsig_done, /* done the events */ } @@ -305,11 +305,12 @@ { int signo; ngx_int_t instance; ngx_err_t err; siginfo_t si; - ngx_event_t *rev, *wev, **queue; + ngx_event_t *rev, *wev; + ngx_queue_t *queue; struct timespec ts, *tp; struct sigaction sa; ngx_connection_t *c; ngx_rtsig_conf_t *rtscf; @@ -402,14 +403,14 @@ if ((si.si_band & (POLLIN|POLLHUP|POLLERR)) && rev->active) { rev->ready = 1; if (flags & NGX_POST_EVENTS) { - queue = (ngx_event_t **) (rev->accept ? - &ngx_posted_accept_events : &ngx_posted_events); + queue = rev->accept ? &ngx_posted_accept_events + : &ngx_posted_events; - ngx_locked_post_event(rev, queue); + ngx_post_event(rev, queue); } else { rev->handler(rev); } } @@ -419,11 +420,11 @@ if ((si.si_band & (POLLOUT|POLLHUP|POLLERR)) && wev->active) { wev->ready = 1; if (flags & NGX_POST_EVENTS) { - ngx_locked_post_event(wev, &ngx_posted_events); + ngx_post_event(wev, &ngx_posted_events); } else { wev->handler(wev); } } @@ -478,11 +479,12 @@ { int name[2], rtsig_max, rtsig_nr, events, ready; size_t len; ngx_err_t err; ngx_uint_t tested, n, i; - ngx_event_t *rev, *wev, **queue; + ngx_event_t *rev, *wev; + ngx_queue_t *queue; ngx_connection_t *c; ngx_rtsig_conf_t *rtscf; ngx_log_debug0(NGX_LOG_DEBUG_EVENT, cycle->log, 0, "rtsig process overflow"); @@ -552,12 +554,10 @@ if (ready <= 0) { continue; } - ngx_mutex_lock(ngx_posted_events_mutex); - for (i = 0; i < n; i++) { c = cycle->files[overflow_list[i].fd]; if (c == NULL) { continue; @@ -571,22 +571,17 @@ && (overflow_list[i].revents & (POLLIN|POLLERR|POLLHUP|POLLNVAL))) { tested++; - if ((flags & NGX_POST_THREAD_EVENTS) && !rev->accept) { - rev->posted_ready = 1; + rev->ready = 1; - } else { - rev->ready = 1; - } - if (flags & NGX_POST_EVENTS) { - queue = (ngx_event_t **) (rev->accept ? - &ngx_posted_accept_events : &ngx_posted_events); + queue = rev->accept ? &ngx_posted_accept_events + : &ngx_posted_events; - ngx_locked_post_event(rev, queue); + ngx_post_event(rev, queue); } else { rev->handler(rev); } } @@ -599,26 +594,19 @@ && (overflow_list[i].revents & (POLLOUT|POLLERR|POLLHUP|POLLNVAL))) { tested++; - if (flags & NGX_POST_THREAD_EVENTS) { - wev->posted_ready = 1; + wev->ready = 1; - } else { - wev->ready = 1; - } - if (flags & NGX_POST_EVENTS) { - ngx_locked_post_event(wev, &ngx_posted_events); + ngx_post_event(wev, &ngx_posted_events); } else { wev->handler(wev); } } } - - ngx_mutex_unlock(ngx_posted_events_mutex); if (tested >= rtscf->overflow_test) { if (ngx_linux_rtsig_max) {