summaryrefslogtreecommitdiffhomepage
path: root/src/http
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2004-02-29 21:03:02 +0000
committerIgor Sysoev <igor@sysoev.ru>2004-02-29 21:03:02 +0000
commitd94049b6320504f3213adfaad939493676e83a3a (patch)
tree7a25b794030cbee22cca6e2bf27aa3569f915d2c /src/http
parent898446c8bacb5b0e1c223dfec4643ebee8d07f8e (diff)
downloadnginx-d94049b6320504f3213adfaad939493676e83a3a.tar.gz
nginx-d94049b6320504f3213adfaad939493676e83a3a.tar.bz2
nginx-0.0.2-2004-03-01-00:03:02 import
Diffstat (limited to 'src/http')
-rw-r--r--src/http/ngx_http_busy_lock.c6
-rw-r--r--src/http/ngx_http_busy_lock.h19
2 files changed, 15 insertions, 10 deletions
diff --git a/src/http/ngx_http_busy_lock.c b/src/http/ngx_http_busy_lock.c
index 30cec2354..e4f682f90 100644
--- a/src/http/ngx_http_busy_lock.c
+++ b/src/http/ngx_http_busy_lock.c
@@ -40,6 +40,7 @@ int ngx_http_busy_lock(ngx_http_busy_lock_t *bl, ngx_http_busy_lock_ctx_t *bc)
if (bl->waiting < bl->max_waiting) {
bl->waiting++;
+
ngx_add_timer(bc->event, 1000);
bc->event->event_handler = bc->event_handler;
@@ -204,6 +205,11 @@ char *ngx_http_set_busy_lock_slot(ngx_conf_t *cf, ngx_command_t *cmd,
}
*blp = bl;
+ /* ngx_calloc_shared() */
+ if (!(bl->mutex = ngx_pcalloc(cf->pool, sizeof(ngx_event_mutex_t)))) {
+ return NGX_CONF_ERROR;
+ }
+
dup = 0;
invalid = 0;
value = cf->args->elts;
diff --git a/src/http/ngx_http_busy_lock.h b/src/http/ngx_http_busy_lock.h
index e600b0180..dd7ab6fdc 100644
--- a/src/http/ngx_http_busy_lock.h
+++ b/src/http/ngx_http_busy_lock.h
@@ -9,20 +9,19 @@
typedef struct {
- u_char *md5_mask;
- char *md5;
- int cachable;
+ u_char *md5_mask;
+ char *md5;
+ int cachable;
- int busy;
- int max_busy;
+ int busy;
+ int max_busy;
- int waiting;
- int max_waiting;
+ int waiting;
+ int max_waiting;
- time_t timeout;
-
- /* ngx_mutex_t mutex; */
+ time_t timeout;
+ ngx_event_mutex_t *mutex;
} ngx_http_busy_lock_t;