comparison src/event/ngx_event_busy_lock.c @ 154:bb61aa162c6b NGINX_0_3_24

nginx 0.3.24 *) Workaround: for bug in FreeBSD kqueue. *) Bugfix: now a response generated by the "post_action" directive is not transferred to a client. *) Bugfix: the memory leaks were occurring if many log files were used. *) Bugfix: the first "proxy_redirect" directive was working inside one location. *) Bugfix: on 64-bit platforms segmentation fault may occurred on start if the many names were used in the "server_name" directives; bug appeared in 0.3.18.
author Igor Sysoev <http://sysoev.ru>
date Wed, 01 Feb 2006 00:00:00 +0300
parents 408f195b3482
children f7cd062ee035
comparison
equal deleted inserted replaced
153:c73ae658b822 154:bb61aa162c6b
18 /* 18 /*
19 * NGX_OK: the busy lock is held 19 * NGX_OK: the busy lock is held
20 * NGX_AGAIN: the all busy locks are held but we will wait the specified time 20 * NGX_AGAIN: the all busy locks are held but we will wait the specified time
21 * NGX_BUSY: ctx->timer == 0: there are many the busy locks 21 * NGX_BUSY: ctx->timer == 0: there are many the busy locks
22 * ctx->timer != 0: there are many the waiting locks 22 * ctx->timer != 0: there are many the waiting locks
23 * NGX_ERROR: an error occured while the mutex locking
24 */ 23 */
25 24
26 ngx_int_t 25 ngx_int_t
27 ngx_event_busy_lock(ngx_event_busy_lock_t *bl, ngx_event_busy_lock_ctx_t *ctx) 26 ngx_event_busy_lock(ngx_event_busy_lock_t *bl, ngx_event_busy_lock_ctx_t *ctx)
28 { 27 {
34 "event busy lock: b:%d mb:%d", 33 "event busy lock: b:%d mb:%d",
35 bl->busy, bl->max_busy); 34 bl->busy, bl->max_busy);
36 35
37 if (bl->busy < bl->max_busy) { 36 if (bl->busy < bl->max_busy) {
38 bl->busy++; 37 bl->busy++;
38
39 rc = NGX_OK; 39 rc = NGX_OK;
40 40
41 } else if (ctx->timer && bl->waiting < bl->max_waiting) { 41 } else if (ctx->timer && bl->waiting < bl->max_waiting) {
42 bl->waiting++; 42 bl->waiting++;
43 ngx_add_timer(ctx->event, ctx->timer); 43 ngx_add_timer(ctx->event, ctx->timer);