summaryrefslogtreecommitdiffhomepage
path: root/src/event/ngx_event_posted.c
blob: 87e506d7198796161b0fb7e5e2f9e9b3bcab49b1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37

/*
 * Copyright (C) Igor Sysoev
 * Copyright (C) Nginx, Inc.
 */


#include <ngx_config.h>
#include <ngx_core.h>
#include <ngx_event.h>


ngx_event_t  *ngx_posted_accept_events;
ngx_event_t  *ngx_posted_events;


void
ngx_event_process_posted(ngx_cycle_t *cycle, ngx_event_t **posted)
{
    ngx_event_t  *ev;

    for ( ;; ) {

        ev = *posted;

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

        if (ev == NULL) {
            return;
        }

        ngx_delete_posted_event(ev);

        ev->handler(ev);
    }
}