Assert pthread_*

parent a46d462c
...@@ -69,9 +69,9 @@ unref_var(struct vmod_globalvar_var *v) ...@@ -69,9 +69,9 @@ unref_var(struct vmod_globalvar_var *v)
{ {
unsigned r; unsigned r;
pthread_mutex_lock(&v->mtx); AZ(pthread_mutex_lock(&v->mtx));
r = --v->refcnt; r = --v->refcnt;
pthread_mutex_unlock(&v->mtx); AZ(pthread_mutex_unlock(&v->mtx));
if (r) if (r)
return; return;
...@@ -88,9 +88,9 @@ ref_var(struct vmod_globalvar_var *v) ...@@ -88,9 +88,9 @@ ref_var(struct vmod_globalvar_var *v)
{ {
AN(v->refcnt); // must be alive AN(v->refcnt); // must be alive
pthread_mutex_lock(&v->mtx); AZ(pthread_mutex_lock(&v->mtx));
v->refcnt++; v->refcnt++;
pthread_mutex_unlock(&v->mtx); AZ(pthread_mutex_unlock(&v->mtx));
} }
static void static void
...@@ -236,11 +236,11 @@ task_ref_var(VRT_CTX, struct vmod_globalvar_var *v, unsigned magic) { ...@@ -236,11 +236,11 @@ task_ref_var(VRT_CTX, struct vmod_globalvar_var *v, unsigned magic) {
n->free_f = free_var_ ## type; \ n->free_f = free_var_ ## type; \
CP_ ## TYPE (n->val, val); \ CP_ ## TYPE (n->val, val); \
\ \
pthread_mutex_lock(&v->mtx); \ AZ(pthread_mutex_lock(&v->mtx)); \
o = v->var; \ o = v->var; \
v->var = n; \ v->var = n; \
v->defined = 1; \ v->defined = 1; \
pthread_mutex_unlock(&v->mtx); \ AZ(pthread_mutex_unlock(&v->mtx)); \
if (o) \ if (o) \
unref_var(o); \ unref_var(o); \
} \ } \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment