comparison src/event/modules/ngx_rtsig_module.c @ 323:ba876b26b76d

nginx-0.0.3-2004-04-21-22:54:33 import
author Igor Sysoev <igor@sysoev.ru>
date Wed, 21 Apr 2004 18:54:33 +0000
parents 56496082668b
children fb4dfb2ac0fc
comparison
equal deleted inserted replaced
322:ab2f8c9a2a45 323:ba876b26b76d
219 } 219 }
220 220
221 expire = 1; 221 expire = 1;
222 222
223 if (ngx_accept_mutex) { 223 if (ngx_accept_mutex) {
224 if (ngx_trylock_accept_mutex(cycle) == NGX_ERROR) { 224 if (ngx_accept_disabled > 0) {
225 return NGX_ERROR; 225 ngx_accept_disabled--;
226 } 226
227 227 } else {
228 if (ngx_accept_mutex_held == 0 228 if (ngx_trylock_accept_mutex(cycle) == NGX_ERROR) {
229 && (timer == NGX_TIMER_INFINITE || timer > ngx_accept_mutex_delay)) 229 return NGX_ERROR;
230 { 230 }
231 timer = ngx_accept_mutex_delay; 231
232 expire = 0; 232 if (ngx_accept_mutex_held == 0
233 && (timer == NGX_TIMER_INFINITE
234 || timer > ngx_accept_mutex_delay))
235 {
236 timer = ngx_accept_mutex_delay;
237 expire = 0;
238 }
233 } 239 }
234 } 240 }
235 241
236 if (timer == NGX_TIMER_INFINITE) { 242 if (timer == NGX_TIMER_INFINITE) {
237 tp = NULL; 243 tp = NULL;
297 303
298 if (!ngx_threaded && !ngx_accept_mutex_held) { 304 if (!ngx_threaded && !ngx_accept_mutex_held) {
299 c->read->event_handler(c->read); 305 c->read->event_handler(c->read);
300 306
301 } else if (c->read->accept) { 307 } else if (c->read->accept) {
302 c->read->event_handler(c->read); 308 if (ngx_accept_disabled > 0) {
309 c->read->event_handler(c->read);
310 }
303 311
304 } else { 312 } else {
305 if (ngx_mutex_lock(ngx_posted_events_mutex) == NGX_ERROR) { 313 if (ngx_mutex_lock(ngx_posted_events_mutex) == NGX_ERROR) {
306 ngx_accept_mutex_unlock(); 314 ngx_accept_mutex_unlock();
307 return NGX_ERROR; 315 return NGX_ERROR;
365 "sigtimedwait() returned unexpected signal: %d", signo); 373 "sigtimedwait() returned unexpected signal: %d", signo);
366 ngx_accept_mutex_unlock(); 374 ngx_accept_mutex_unlock();
367 return NGX_ERROR; 375 return NGX_ERROR;
368 } 376 }
369 377
370
371 ngx_accept_mutex_unlock(); 378 ngx_accept_mutex_unlock();
372 379
373 if (expire && delta) { 380 if (expire && delta) {
374 ngx_event_expire_timers((ngx_msec_t) delta); 381 ngx_event_expire_timers((ngx_msec_t) delta);
375 } 382 }