Assert pthread_*

parent a46d462c
......@@ -69,9 +69,9 @@ unref_var(struct vmod_globalvar_var *v)
{
unsigned r;
pthread_mutex_lock(&v->mtx);
AZ(pthread_mutex_lock(&v->mtx));
r = --v->refcnt;
pthread_mutex_unlock(&v->mtx);
AZ(pthread_mutex_unlock(&v->mtx));
if (r)
return;
......@@ -88,9 +88,9 @@ ref_var(struct vmod_globalvar_var *v)
{
AN(v->refcnt); // must be alive
pthread_mutex_lock(&v->mtx);
AZ(pthread_mutex_lock(&v->mtx));
v->refcnt++;
pthread_mutex_unlock(&v->mtx);
AZ(pthread_mutex_unlock(&v->mtx));
}
static void
......@@ -236,11 +236,11 @@ task_ref_var(VRT_CTX, struct vmod_globalvar_var *v, unsigned magic) {
n->free_f = free_var_ ## type; \
CP_ ## TYPE (n->val, val); \
\
pthread_mutex_lock(&v->mtx); \
AZ(pthread_mutex_lock(&v->mtx)); \
o = v->var; \
v->var = n; \
v->defined = 1; \
pthread_mutex_unlock(&v->mtx); \
AZ(pthread_mutex_unlock(&v->mtx)); \
if (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