summaryrefslogtreecommitdiffhomepage
path: root/src/http
diff options
context:
space:
mode:
Diffstat (limited to '')
-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;