Mercurial > hg > nginx-quic
comparison src/event/modules/ngx_eventport_module.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 | 56b5ef2c9e37 |
children | 3f5f0ab59b35 |
comparison
equal
deleted
inserted
replaced
5819:8e7ee4c70a3c | 5820:3377f9459e99 |
---|---|
464 ngx_log_error(NGX_LOG_ALERT, cycle->log, 0, | 464 ngx_log_error(NGX_LOG_ALERT, cycle->log, 0, |
465 "port_getn() returned no events without timeout"); | 465 "port_getn() returned no events without timeout"); |
466 return NGX_ERROR; | 466 return NGX_ERROR; |
467 } | 467 } |
468 | 468 |
469 ngx_mutex_lock(ngx_posted_events_mutex); | |
470 | |
471 for (i = 0; i < events; i++) { | 469 for (i = 0; i < events; i++) { |
472 | 470 |
473 if (event_list[i].portev_source == PORT_SOURCE_TIMER) { | 471 if (event_list[i].portev_source == PORT_SOURCE_TIMER) { |
474 ngx_time_update(); | 472 ngx_time_update(); |
475 continue; | 473 continue; |
532 | 530 |
533 rev->active = 0; | 531 rev->active = 0; |
534 wev->active = 0; | 532 wev->active = 0; |
535 | 533 |
536 if (revents & POLLIN) { | 534 if (revents & POLLIN) { |
537 | 535 rev->ready = 1; |
538 if ((flags & NGX_POST_THREAD_EVENTS) && !rev->accept) { | |
539 rev->posted_ready = 1; | |
540 | |
541 } else { | |
542 rev->ready = 1; | |
543 } | |
544 | 536 |
545 if (flags & NGX_POST_EVENTS) { | 537 if (flags & NGX_POST_EVENTS) { |
546 queue = (ngx_event_t **) (rev->accept ? | 538 queue = rev->accept ? &ngx_posted_accept_events |
547 &ngx_posted_accept_events : &ngx_posted_events); | 539 : &ngx_posted_events; |
548 | 540 |
549 ngx_locked_post_event(rev, queue); | 541 ngx_post_event(rev, queue); |
550 | 542 |
551 } else { | 543 } else { |
552 rev->handler(rev); | 544 rev->handler(rev); |
553 | 545 |
554 if (ev->closed || ev->instance != instance) { | 546 if (ev->closed || ev->instance != instance) { |
572 } | 564 } |
573 } | 565 } |
574 } | 566 } |
575 | 567 |
576 if (revents & POLLOUT) { | 568 if (revents & POLLOUT) { |
577 | 569 wev->ready = 1; |
578 if (flags & NGX_POST_THREAD_EVENTS) { | |
579 wev->posted_ready = 1; | |
580 | |
581 } else { | |
582 wev->ready = 1; | |
583 } | |
584 | 570 |
585 if (flags & NGX_POST_EVENTS) { | 571 if (flags & NGX_POST_EVENTS) { |
586 ngx_locked_post_event(wev, &ngx_posted_events); | 572 ngx_post_event(wev, &ngx_posted_events); |
587 | 573 |
588 } else { | 574 } else { |
589 wev->handler(wev); | 575 wev->handler(wev); |
590 } | 576 } |
591 } | 577 } |
598 event_list[i].portev_object); | 584 event_list[i].portev_object); |
599 continue; | 585 continue; |
600 } | 586 } |
601 } | 587 } |
602 | 588 |
603 ngx_mutex_unlock(ngx_posted_events_mutex); | |
604 | |
605 return NGX_OK; | 589 return NGX_OK; |
606 } | 590 } |
607 | 591 |
608 | 592 |
609 static void * | 593 static void * |