comparison src/event/ngx_event.c @ 5820:3377f9459e99

Events: removed broken thread support from posted events. It's mostly dead code. And the idea of thread support for this task has been deprecated.
author Valentin Bartenev <vbart@nginx.com>
date Mon, 01 Sep 2014 18:20:03 +0400
parents 11599a3d0c7c
children 3f5f0ab59b35
comparison
equal deleted inserted replaced
5819:8e7ee4c70a3c 5820:3377f9459e99
266 266
267 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0, 267 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
268 "posted events %p", ngx_posted_events); 268 "posted events %p", ngx_posted_events);
269 269
270 if (ngx_posted_events) { 270 if (ngx_posted_events) {
271 if (ngx_threaded) { 271 ngx_event_process_posted(cycle, &ngx_posted_events);
272 ngx_wakeup_worker_thread(cycle);
273
274 } else {
275 ngx_event_process_posted(cycle, &ngx_posted_events);
276 }
277 } 272 }
278 } 273 }
279 274
280 275
281 ngx_int_t 276 ngx_int_t
615 610
616 ngx_use_accept_mutex = 0; 611 ngx_use_accept_mutex = 0;
617 612
618 #endif 613 #endif
619 614
620 #if (NGX_THREADS)
621 ngx_posted_events_mutex = ngx_mutex_init(cycle->log, 0);
622 if (ngx_posted_events_mutex == NULL) {
623 return NGX_ERROR;
624 }
625 #endif
626
627 if (ngx_event_timer_init(cycle->log) == NGX_ERROR) { 615 if (ngx_event_timer_init(cycle->log) == NGX_ERROR) {
628 return NGX_ERROR; 616 return NGX_ERROR;
629 } 617 }
630 618
631 for (m = 0; ngx_modules[m]; m++) { 619 for (m = 0; ngx_modules[m]; m++) {
710 698
711 rev = cycle->read_events; 699 rev = cycle->read_events;
712 for (i = 0; i < cycle->connection_n; i++) { 700 for (i = 0; i < cycle->connection_n; i++) {
713 rev[i].closed = 1; 701 rev[i].closed = 1;
714 rev[i].instance = 1; 702 rev[i].instance = 1;
715 #if (NGX_THREADS)
716 rev[i].lock = &c[i].lock;
717 rev[i].own_lock = &c[i].lock;
718 #endif
719 } 703 }
720 704
721 cycle->write_events = ngx_alloc(sizeof(ngx_event_t) * cycle->connection_n, 705 cycle->write_events = ngx_alloc(sizeof(ngx_event_t) * cycle->connection_n,
722 cycle->log); 706 cycle->log);
723 if (cycle->write_events == NULL) { 707 if (cycle->write_events == NULL) {
725 } 709 }
726 710
727 wev = cycle->write_events; 711 wev = cycle->write_events;
728 for (i = 0; i < cycle->connection_n; i++) { 712 for (i = 0; i < cycle->connection_n; i++) {
729 wev[i].closed = 1; 713 wev[i].closed = 1;
730 #if (NGX_THREADS)
731 wev[i].lock = &c[i].lock;
732 wev[i].own_lock = &c[i].lock;
733 #endif
734 } 714 }
735 715
736 i = cycle->connection_n; 716 i = cycle->connection_n;
737 next = NULL; 717 next = NULL;
738 718