Commit 45c79d06 authored by Nils Goroll's avatar Nils Goroll

Save the stv value to return within the protected reagion

commit c457b965 was incomplete

This should fix #2128 for good
parent bd9269aa
......@@ -52,6 +52,7 @@ const struct stevedore *
STV_next()
{
static struct stevedore *stv;
struct stevedore *r;
static pthread_mutex_t mtx = PTHREAD_MUTEX_INITIALIZER;
AZ(pthread_mutex_lock(&mtx));
......@@ -61,9 +62,10 @@ STV_next()
stv = NULL;
AN(STV__iter(&stv));
}
r = stv;
AZ(pthread_mutex_unlock(&mtx));
AN(stv);
return (stv);
AN(r);
return (r);
}
/*-------------------------------------------------------------------
......
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