Mercurial > hg > nginx
comparison src/event/modules/ngx_select_module.c @ 230:1119faf4635a
nginx-0.0.1-2004-01-16-09:15:48 import
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Fri, 16 Jan 2004 06:15:48 +0000 |
parents | 05592fd7a436 |
children | e6c005b66b3a |
comparison
equal
deleted
inserted
replaced
229:ce6b72fe33fe | 230:1119faf4635a |
---|---|
1 | 1 |
2 /* | 2 /* |
3 * Copyright (C) 2002-2003 Igor Sysoev, http://sysoev.ru | 3 * Copyright (C) 2002-2004 Igor Sysoev, http://sysoev.ru/en/ |
4 */ | 4 */ |
5 | 5 |
6 | 6 |
7 #include <ngx_config.h> | 7 #include <ngx_config.h> |
8 #include <ngx_core.h> | 8 #include <ngx_core.h> |
98 ngx_alloc(sizeof(ngx_event_t *) * 2 * cycle->connection_n, | 98 ngx_alloc(sizeof(ngx_event_t *) * 2 * cycle->connection_n, |
99 cycle->log), | 99 cycle->log), |
100 NGX_ERROR); | 100 NGX_ERROR); |
101 } | 101 } |
102 | 102 |
103 if (ngx_event_timer_init(cycle) == NGX_ERROR) { | |
104 return NGX_ERROR; | |
105 } | |
106 | |
107 ngx_io = ngx_os_io; | 103 ngx_io = ngx_os_io; |
108 | 104 |
109 ngx_event_actions = ngx_select_module_ctx.actions; | 105 ngx_event_actions = ngx_select_module_ctx.actions; |
110 | 106 |
111 ngx_event_flags = NGX_USE_LEVEL_EVENT|NGX_USE_ONESHOT_EVENT; | 107 ngx_event_flags = NGX_USE_LEVEL_EVENT|NGX_USE_ONESHOT_EVENT; |
120 } | 116 } |
121 | 117 |
122 | 118 |
123 static void ngx_select_done(ngx_cycle_t *cycle) | 119 static void ngx_select_done(ngx_cycle_t *cycle) |
124 { | 120 { |
125 ngx_event_timer_done(cycle); | |
126 | |
127 ngx_free(event_index); | 121 ngx_free(event_index); |
128 ngx_free(ready_index); | 122 ngx_free(ready_index); |
129 | 123 |
130 event_index = NULL; | 124 event_index = NULL; |
131 } | 125 } |
260 | 254 |
261 work_read_fd_set = master_read_fd_set; | 255 work_read_fd_set = master_read_fd_set; |
262 work_write_fd_set = master_write_fd_set; | 256 work_write_fd_set = master_write_fd_set; |
263 | 257 |
264 timer = ngx_event_find_timer(); | 258 timer = ngx_event_find_timer(); |
259 ngx_old_elapsed_msec = ngx_elapsed_msec; | |
265 | 260 |
266 if (timer) { | 261 if (timer) { |
267 #if (HAVE_SELECT_CHANGE_TIMEOUT) | 262 #if (HAVE_SELECT_CHANGE_TIMEOUT) |
268 delta = 0; | 263 delta = 0; |
269 #else | 264 #else |