Mercurial > hg > nginx
comparison src/event/modules/ngx_kqueue_module.c @ 79:eacfdd1c31b9
nginx-0.0.1-2003-04-22-19:02:58 import
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Tue, 22 Apr 2003 15:02:58 +0000 |
parents | e43f406e4525 |
children | 3973260705cc |
comparison
equal
deleted
inserted
replaced
78:9f81437e0ad3 | 79:eacfdd1c31b9 |
---|---|
10 #include <ngx_connection.h> | 10 #include <ngx_connection.h> |
11 #include <ngx_event.h> | 11 #include <ngx_event.h> |
12 #include <ngx_event_timer.h> | 12 #include <ngx_event_timer.h> |
13 #include <ngx_kqueue_module.h> | 13 #include <ngx_kqueue_module.h> |
14 | 14 |
15 #if (USE_KQUEUE) && !(HAVE_KQUEUE) | |
16 #error "kqueue is not supported on this platform" | |
17 #endif | |
18 | |
19 | 15 |
20 /* STUB */ | 16 /* STUB */ |
21 #define KQUEUE_NCHANGES 512 | 17 #define KQUEUE_NCHANGES 512 |
22 #define KQUEUE_NEVENTS 512 | 18 #define KQUEUE_NEVENTS 512 |
23 | 19 |
24 | 20 |
25 /* should be per-thread */ | 21 /* should be per-thread if threads are used without thread pool */ |
26 #if 1 | 22 #if 1 |
27 int kq; | 23 int kq; |
28 #else | 24 #else |
29 static int kq; | 25 static int kq; |
30 #endif | 26 #endif |
31 static struct kevent *change_list, *event_list; | 27 static struct kevent *change_list, *event_list; |
32 static unsigned int nchanges; | 28 static unsigned int nchanges; |
58 timer_queue = ngx_event_init_timer(log); | 54 timer_queue = ngx_event_init_timer(log); |
59 if (timer_queue == NULL) { | 55 if (timer_queue == NULL) { |
60 return NGX_ERROR; | 56 return NGX_ERROR; |
61 } | 57 } |
62 | 58 |
63 #if !(USE_KQUEUE) | |
64 ngx_event_actions.add = ngx_kqueue_add_event; | 59 ngx_event_actions.add = ngx_kqueue_add_event; |
65 ngx_event_actions.del = ngx_kqueue_del_event; | 60 ngx_event_actions.del = ngx_kqueue_del_event; |
66 ngx_event_actions.timer = ngx_event_add_timer; | 61 ngx_event_actions.timer = ngx_event_add_timer; |
67 ngx_event_actions.process = ngx_kqueue_process_events; | 62 ngx_event_actions.process = ngx_kqueue_process_events; |
68 | 63 |
86 #endif | 81 #endif |
87 | 82 |
88 |NGX_HAVE_KQUEUE_EVENT; | 83 |NGX_HAVE_KQUEUE_EVENT; |
89 | 84 |
90 ngx_write_chain_proc = ngx_freebsd_write_chain; | 85 ngx_write_chain_proc = ngx_freebsd_write_chain; |
91 | |
92 #endif | |
93 | 86 |
94 #endif | 87 #endif |
95 | 88 |
96 return NGX_OK; | 89 return NGX_OK; |
97 } | 90 } |