comparison src/event/ngx_event_accept.c @ 306:6b91bfbc4123

nginx-0.0.3-2004-04-05-00:32:09 import
author Igor Sysoev <igor@sysoev.ru>
date Sun, 04 Apr 2004 20:32:09 +0000
parents 00c5660d2707
children ce375c313e96
comparison
equal deleted inserted replaced
305:4b1a3a4acc60 306:6b91bfbc4123
216 216
217 c->listening = ls->listening; 217 c->listening = ls->listening;
218 c->sockaddr = sa; 218 c->sockaddr = sa;
219 c->socklen = len; 219 c->socklen = len;
220 220
221 rev->instance = (u_char) !instance; 221 if (ngx_event_flags & NGX_HAVE_INSTANCE_EVENT) {
222 rev->returned_instance = (u_char) rinstance; 222 rev->use_instance = 1;
223 223 rev->instance = (u_char) !instance;
224 wev->instance = (u_char) !instance; 224 rev->returned_instance = (u_char) rinstance;
225 wev->returned_instance = (u_char) winstance; 225
226 wev->use_instance = 1;
227 wev->instance = (u_char) !instance;
228 wev->returned_instance = (u_char) winstance;
229 }
226 230
227 rev->index = NGX_INVALID_INDEX; 231 rev->index = NGX_INVALID_INDEX;
228 wev->index = NGX_INVALID_INDEX; 232 wev->index = NGX_INVALID_INDEX;
229 233
230 rev->data = c; 234 rev->data = c;
300 } 304 }
301 305
302 306
303 ngx_int_t ngx_trylock_accept_mutex(ngx_cycle_t *cycle) 307 ngx_int_t ngx_trylock_accept_mutex(ngx_cycle_t *cycle)
304 { 308 {
305 if (*ngx_accept_mutex == 0 && ngx_atomic_cmp_set(ngx_accept_mutex, 0, 1)) { 309 if (*ngx_accept_mutex == 0
310 && ngx_atomic_cmp_set(ngx_accept_mutex, 0, ngx_pid))
311 {
306 312
307 ngx_log_debug0(NGX_LOG_DEBUG_EVENT, cycle->log, 0, 313 ngx_log_debug0(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
308 "accept mutex locked"); 314 "accept mutex locked");
309 315
310 if (!ngx_accept_mutex_held) { 316 if (!ngx_accept_mutex_held) {