ngx_event_posted.c revision e18a033b
1
2/*
3 * Copyright (C) Igor Sysoev
4 * Copyright (C) Nginx, Inc.
5 */
6
7
8#include <ngx_config.h>
9#include <ngx_core.h>
10#include <ngx_event.h>
11
12
13ngx_queue_t  ngx_posted_accept_events;
14ngx_queue_t  ngx_posted_events;
15
16
17void
18ngx_event_process_posted(ngx_cycle_t *cycle, ngx_queue_t *posted)
19{
20    ngx_queue_t  *q;
21    ngx_event_t  *ev;
22
23    while (!ngx_queue_empty(posted)) {
24
25        q = ngx_queue_head(posted);
26        ev = ngx_queue_data(q, ngx_event_t, queue);
27
28        ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
29                      "posted event %p", ev);
30
31        ngx_delete_posted_event(ev);
32
33        ev->handler(ev);
34    }
35}
36