comparison src/event/ngx_event.h @ 301:744965ec6275

nginx-0.0.3-2004-03-31-19:26:46 import
author Igor Sysoev <igor@sysoev.ru>
date Wed, 31 Mar 2004 15:26:46 +0000
parents 87e73f067470
children 1526e7686b20
comparison
equal deleted inserted replaced
300:502b03d9d2a3 301:744965ec6275
64 64
65 unsigned char write:1; 65 unsigned char write:1;
66 66
67 /* used to detect the stale events in kqueue, rt signals and epoll */ 67 /* used to detect the stale events in kqueue, rt signals and epoll */
68 unsigned char instance:1; 68 unsigned char instance:1;
69 unsigned char returned_instance:1;
69 70
70 /* 71 /*
71 * the event was passed or would be passed to a kernel; 72 * the event was passed or would be passed to a kernel;
72 * in aio mode - operation was posted. 73 * in aio mode - operation was posted.
73 */ 74 */
74 unsigned char active:1; 75 unsigned char active:1;
75 76
76 unsigned char disabled:1; 77 unsigned char disabled:1;
77 78
79 unsigned char posted:1;
80
78 /* the ready event; in aio mode 0 means that no operation can be posted */ 81 /* the ready event; in aio mode 0 means that no operation can be posted */
79 unsigned char ready:1; 82 unsigned char ready:1;
80 83
81 /* aio operation is complete */ 84 /* aio operation is complete */
82 unsigned char complete:1; 85 unsigned short complete:1;
83 86
84 unsigned short eof:1; 87 unsigned short eof:1;
85 unsigned short error:1; 88 unsigned short error:1;
86 89
87 unsigned short timedout:1; 90 unsigned short timedout:1;
90 unsigned short delayed:1; 93 unsigned short delayed:1;
91 94
92 unsigned short read_discarded:1; 95 unsigned short read_discarded:1;
93 96
94 unsigned short unexpected_eof:1; 97 unsigned short unexpected_eof:1;
98
99 unsigned short accept:1;
95 100
96 unsigned short deferred_accept:1; 101 unsigned short deferred_accept:1;
97 102
98 /* TODO: aio_eof and kq_eof can be the single pending_eof */ 103 /* TODO: aio_eof and kq_eof can be the single pending_eof */
99 /* the pending eof in aio chain operation */ 104 /* the pending eof in aio chain operation */
176 int (*disable)(ngx_event_t *ev, int event, u_int flags); 181 int (*disable)(ngx_event_t *ev, int event, u_int flags);
177 182
178 int (*add_conn)(ngx_connection_t *c); 183 int (*add_conn)(ngx_connection_t *c);
179 int (*del_conn)(ngx_connection_t *c, u_int flags); 184 int (*del_conn)(ngx_connection_t *c, u_int flags);
180 185
181 int (*process)(ngx_log_t *log); 186 int (*process)(ngx_cycle_t *cycle);
182 int (*init)(ngx_cycle_t *cycle); 187 int (*init)(ngx_cycle_t *cycle);
183 void (*done)(ngx_cycle_t *cycle); 188 void (*done)(ngx_cycle_t *cycle);
184 } ngx_event_actions_t; 189 } ngx_event_actions_t;
185 190
186 191
389 394
390 extern ngx_thread_volatile ngx_event_t *ngx_posted_events; 395 extern ngx_thread_volatile ngx_event_t *ngx_posted_events;
391 #if (NGX_THREADS) 396 #if (NGX_THREADS)
392 extern ngx_mutex_t *ngx_posted_events_mutex; 397 extern ngx_mutex_t *ngx_posted_events_mutex;
393 #endif 398 #endif
399 extern ngx_atomic_t *ngx_accept_mutex;
400 extern ngx_uint_t ngx_accept_token;
401
394 402
395 extern int ngx_event_flags; 403 extern int ngx_event_flags;
396 extern ngx_module_t ngx_events_module; 404 extern ngx_module_t ngx_events_module;
397 extern ngx_module_t ngx_event_core_module; 405 extern ngx_module_t ngx_event_core_module;
398 406
401 (*(ngx_get_conf(conf_ctx, ngx_events_module))) [module.ctx_index]; 409 (*(ngx_get_conf(conf_ctx, ngx_events_module))) [module.ctx_index];
402 410
403 411
404 412
405 void ngx_event_accept(ngx_event_t *ev); 413 void ngx_event_accept(ngx_event_t *ev);
414 ngx_int_t ngx_trylock_accept_mutex(ngx_cycle_t *cycle);
415 ngx_int_t ngx_disable_accept_events(ngx_cycle_t *cycle);
416 ngx_int_t ngx_enable_accept_events(ngx_cycle_t *cycle);
417
406 418
407 #if (WIN32) 419 #if (WIN32)
408 void ngx_event_acceptex(ngx_event_t *ev); 420 void ngx_event_acceptex(ngx_event_t *ev);
409 int ngx_event_post_acceptex(ngx_listening_t *ls, int n); 421 int ngx_event_post_acceptex(ngx_listening_t *ls, int n);
410 #endif 422 #endif