src/event/ngx_event_posted.c - nginx-1.7.10

Global variables defined

Functions defined

Source code


  1. /*
  2. * Copyright (C) Igor Sysoev
  3. * Copyright (C) Nginx, Inc.
  4. */


  5. #include <ngx_config.h>
  6. #include <ngx_core.h>
  7. #include <ngx_event.h>


  8. ngx_queue_t  ngx_posted_accept_events;
  9. ngx_queue_t  ngx_posted_events;


  10. void
  11. ngx_event_process_posted(ngx_cycle_t *cycle, ngx_queue_t *posted)
  12. {
  13.     ngx_queue_t  *q;
  14.     ngx_event_t  *ev;

  15.     while (!ngx_queue_empty(posted)) {

  16.         q = ngx_queue_head(posted);
  17.         ev = ngx_queue_data(q, ngx_event_t, queue);

  18.         ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
  19.                       "posted event %p", ev);

  20.         ngx_delete_posted_event(ev);

  21.         ev->handler(ev);
  22.     }
  23. }