Mercurial > hg > nginx-quic
comparison src/event/modules/ngx_devpoll_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 | 6b479db5b52b |
children | 3f5f0ab59b35 |
comparison
equal
deleted
inserted
replaced
5819:8e7ee4c70a3c | 5820:3377f9459e99 |
---|---|
402 ngx_log_error(NGX_LOG_ALERT, cycle->log, 0, | 402 ngx_log_error(NGX_LOG_ALERT, cycle->log, 0, |
403 "ioctl(DP_POLL) returned no events without timeout"); | 403 "ioctl(DP_POLL) returned no events without timeout"); |
404 return NGX_ERROR; | 404 return NGX_ERROR; |
405 } | 405 } |
406 | 406 |
407 ngx_mutex_lock(ngx_posted_events_mutex); | |
408 | |
409 for (i = 0; i < events; i++) { | 407 for (i = 0; i < events; i++) { |
410 | 408 |
411 fd = event_list[i].fd; | 409 fd = event_list[i].fd; |
412 revents = event_list[i].revents; | 410 revents = event_list[i].revents; |
413 | 411 |
493 } | 491 } |
494 | 492 |
495 rev = c->read; | 493 rev = c->read; |
496 | 494 |
497 if ((revents & POLLIN) && rev->active) { | 495 if ((revents & POLLIN) && rev->active) { |
498 | 496 rev->ready = 1; |
499 if ((flags & NGX_POST_THREAD_EVENTS) && !rev->accept) { | |
500 rev->posted_ready = 1; | |
501 | |
502 } else { | |
503 rev->ready = 1; | |
504 } | |
505 | 497 |
506 if (flags & NGX_POST_EVENTS) { | 498 if (flags & NGX_POST_EVENTS) { |
507 queue = (ngx_event_t **) (rev->accept ? | 499 queue = rev->accept ? &ngx_posted_accept_events |
508 &ngx_posted_accept_events : &ngx_posted_events); | 500 : &ngx_posted_events; |
509 | 501 |
510 ngx_locked_post_event(rev, queue); | 502 ngx_post_event(rev, queue); |
511 | 503 |
512 } else { | 504 } else { |
513 instance = rev->instance; | 505 instance = rev->instance; |
514 | 506 |
515 rev->handler(rev); | 507 rev->handler(rev); |
521 } | 513 } |
522 | 514 |
523 wev = c->write; | 515 wev = c->write; |
524 | 516 |
525 if ((revents & POLLOUT) && wev->active) { | 517 if ((revents & POLLOUT) && wev->active) { |
526 | 518 wev->ready = 1; |
527 if (flags & NGX_POST_THREAD_EVENTS) { | |
528 wev->posted_ready = 1; | |
529 | |
530 } else { | |
531 wev->ready = 1; | |
532 } | |
533 | 519 |
534 if (flags & NGX_POST_EVENTS) { | 520 if (flags & NGX_POST_EVENTS) { |
535 ngx_locked_post_event(wev, &ngx_posted_events); | 521 ngx_post_event(wev, &ngx_posted_events); |
536 | 522 |
537 } else { | 523 } else { |
538 wev->handler(wev); | 524 wev->handler(wev); |
539 } | 525 } |
540 } | 526 } |
541 } | 527 } |
542 | 528 |
543 ngx_mutex_unlock(ngx_posted_events_mutex); | |
544 | |
545 return NGX_OK; | 529 return NGX_OK; |
546 } | 530 } |
547 | 531 |
548 | 532 |
549 static void * | 533 static void * |