aboutsummaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-rw-r--r--src/core/ngx_cycle.c4
-rw-r--r--src/core/ngx_cycle.h1
-rw-r--r--src/core/ngx_rwlock.c8
3 files changed, 12 insertions, 1 deletions
diff --git a/src/core/ngx_cycle.c b/src/core/ngx_cycle.c
index 11e413f4e..4646978f7 100644
--- a/src/core/ngx_cycle.c
+++ b/src/core/ngx_cycle.c
@@ -441,7 +441,8 @@ ngx_init_cycle(ngx_cycle_t *old_cycle)
}
if (shm_zone[i].tag == oshm_zone[n].tag
- && shm_zone[i].shm.size == oshm_zone[n].shm.size)
+ && shm_zone[i].shm.size == oshm_zone[n].shm.size
+ && !shm_zone[i].noreuse)
{
shm_zone[i].shm.addr = oshm_zone[n].shm.addr;
@@ -1234,6 +1235,7 @@ ngx_shared_memory_add(ngx_conf_t *cf, ngx_str_t *name, size_t size, void *tag)
shm_zone->shm.exists = 0;
shm_zone->init = NULL;
shm_zone->tag = tag;
+ shm_zone->noreuse = 0;
return shm_zone;
}
diff --git a/src/core/ngx_cycle.h b/src/core/ngx_cycle.h
index be90a7281..28f1886cc 100644
--- a/src/core/ngx_cycle.h
+++ b/src/core/ngx_cycle.h
@@ -31,6 +31,7 @@ struct ngx_shm_zone_s {
ngx_shm_t shm;
ngx_shm_zone_init_pt init;
void *tag;
+ ngx_uint_t noreuse; /* unsigned noreuse:1; */
};
diff --git a/src/core/ngx_rwlock.c b/src/core/ngx_rwlock.c
index 066c67de8..1404c6edf 100644
--- a/src/core/ngx_rwlock.c
+++ b/src/core/ngx_rwlock.c
@@ -109,4 +109,12 @@ ngx_rwlock_unlock(ngx_atomic_t *lock)
}
+#else
+
+#if (NGX_HTTP_UPSTREAM_ZONE)
+
+#error ngx_atomic_cmp_set() is not defined!
+
+#endif
+
#endif