Mercurial > hg > nginx-quic
comparison src/event/ngx_event.h @ 194:2357fa41738a
nginx-0.0.1-2003-11-21-09:30:49 import
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Fri, 21 Nov 2003 06:30:49 +0000 |
parents | c966c09be66b |
children | 8dee38ea9117 |
comparison
equal
deleted
inserted
replaced
193:dd66383796a5 | 194:2357fa41738a |
---|---|
4 | 4 |
5 #include <ngx_config.h> | 5 #include <ngx_config.h> |
6 #include <ngx_core.h> | 6 #include <ngx_core.h> |
7 | 7 |
8 | 8 |
9 #define NGX_INVALID_INDEX 0x80000000 | 9 #define NGX_INVALID_INDEX 0xd0d0d0d0 |
10 | 10 |
11 | 11 |
12 #if (HAVE_IOCP) | 12 #if (HAVE_IOCP) |
13 | 13 |
14 typedef struct { | 14 typedef struct { |
26 void (*event_handler)(ngx_event_t *ev); | 26 void (*event_handler)(ngx_event_t *ev); |
27 | 27 |
28 void *context; | 28 void *context; |
29 char *action; | 29 char *action; |
30 | 30 |
31 unsigned int index; | 31 u_int index; |
32 | 32 |
33 /* queue in mutex(), aio_read(), aio_write() */ | 33 /* queue in mutex(), aio_read(), aio_write() */ |
34 ngx_event_t *prev; | 34 ngx_event_t *prev; |
35 ngx_event_t *next; | 35 ngx_event_t *next; |
36 | 36 |
228 */ | 228 */ |
229 | 229 |
230 #define NGX_CLOSE_EVENT 1 | 230 #define NGX_CLOSE_EVENT 1 |
231 | 231 |
232 | 232 |
233 /* this flag has meaning only for kqueue */ | 233 /* these flags have a meaning only for kqueue */ |
234 #define NGX_LOWAT_EVENT 0 | 234 #define NGX_LOWAT_EVENT 0 |
235 #define NGX_DISABLE_EVENT 0 | |
235 | 236 |
236 | 237 |
237 #if (HAVE_KQUEUE) | 238 #if (HAVE_KQUEUE) |
238 | 239 |
239 #define NGX_READ_EVENT EVFILT_READ | 240 #define NGX_READ_EVENT EVFILT_READ |
254 | 255 |
255 #define NGX_LEVEL_EVENT 0 | 256 #define NGX_LEVEL_EVENT 0 |
256 #define NGX_ONESHOT_EVENT EV_ONESHOT | 257 #define NGX_ONESHOT_EVENT EV_ONESHOT |
257 #define NGX_CLEAR_EVENT EV_CLEAR | 258 #define NGX_CLEAR_EVENT EV_CLEAR |
258 | 259 |
260 #undef NGX_DISABLE_EVENT | |
261 #define NGX_DISABLE_EVENT EV_DISABLE | |
262 | |
259 | 263 |
260 #elif (HAVE_POLL) | 264 #elif (HAVE_POLL) |
261 | 265 |
262 #define NGX_READ_EVENT POLLIN | 266 #define NGX_READ_EVENT POLLIN |
263 #define NGX_WRITE_EVENT POLLOUT | 267 #define NGX_WRITE_EVENT POLLOUT |
360 #include <ngx_iocp_module.h> | 364 #include <ngx_iocp_module.h> |
361 #endif | 365 #endif |
362 | 366 |
363 | 367 |
364 | 368 |
365 ngx_inline static int ngx_handle_read_event(ngx_event_t *rev, int flags) | 369 ngx_inline static int ngx_handle_read_event(ngx_event_t *rev, u_int flags) |
366 { | 370 { |
367 if (ngx_event_flags & NGX_USE_CLEAR_EVENT) { | 371 if (ngx_event_flags & NGX_USE_CLEAR_EVENT) { |
368 | 372 |
369 /* kqueue */ | 373 /* kqueue */ |
370 | 374 |
430 | 434 |
431 return NGX_OK; | 435 return NGX_OK; |
432 } | 436 } |
433 | 437 |
434 | 438 |
435 ngx_inline static int ngx_handle_write_event(ngx_event_t *wev, int flags) | 439 ngx_inline static int ngx_handle_write_event(ngx_event_t *wev, u_int flags) |
436 { | 440 { |
437 if (ngx_event_flags & NGX_USE_CLEAR_EVENT) { | 441 if (ngx_event_flags & NGX_USE_CLEAR_EVENT) { |
438 | 442 |
439 /* kqueue */ | 443 /* kqueue */ |
440 | 444 |