Back to home page

Nginx displayed by LXR

Source navigation ]
Diff markup ]
Identifier search ]
general search ]
 
 
Version: nginx-1.19.2 ]​[ nginx-1.18.0 ]​

0001 
0002 /*
0003  * Copyright (C) Igor Sysoev
0004  * Copyright (C) Nginx, Inc.
0005  */
0006 
0007 
0008 #include <ngx_config.h>
0009 #include <ngx_core.h>
0010 #include <ngx_event.h>
0011 
0012 
0013 ngx_queue_t  ngx_posted_accept_events;
0014 ngx_queue_t  ngx_posted_next_events;
0015 ngx_queue_t  ngx_posted_events;
0016 
0017 
0018 void
0019 ngx_event_process_posted(ngx_cycle_t *cycle, ngx_queue_t *posted)
0020 {
0021     ngx_queue_t  *q;
0022     ngx_event_t  *ev;
0023 
0024     while (!ngx_queue_empty(posted)) {
0025 
0026         q = ngx_queue_head(posted);
0027         ev = ngx_queue_data(q, ngx_event_t, queue);
0028 
0029         ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
0030                       "posted event %p", ev);
0031 
0032         ngx_delete_posted_event(ev);
0033 
0034         ev->handler(ev);
0035     }
0036 }
0037 
0038 
0039 void
0040 ngx_event_move_posted_next(ngx_cycle_t *cycle)
0041 {
0042     ngx_queue_t  *q;
0043     ngx_event_t  *ev;
0044 
0045     for (q = ngx_queue_head(&ngx_posted_next_events);
0046          q != ngx_queue_sentinel(&ngx_posted_next_events);
0047          q = ngx_queue_next(q))
0048     {
0049         ev = ngx_queue_data(q, ngx_event_t, queue);
0050 
0051         ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
0052                       "posted next event %p", ev);
0053 
0054         ev->ready = 1;
0055         ev->available = -1;
0056     }
0057 
0058     ngx_queue_add(&ngx_posted_events, &ngx_posted_next_events);
0059     ngx_queue_init(&ngx_posted_next_events);
0060 }