Commit c457b965 authored by Nils Goroll's avatar Nils Goroll

serialize STV_next

May be a preliminary solution should phk decide to do this differently.

Fixes #2128
parent 04c1c92d
......@@ -52,13 +52,16 @@ const struct stevedore *
STV_next()
{
static struct stevedore *stv;
static pthread_mutex_t mtx = PTHREAD_MUTEX_INITIALIZER;
AZ(pthread_mutex_lock(&mtx));
if (!STV__iter(&stv))
AN(STV__iter(&stv));
if (stv == stv_transient) {
stv = NULL;
AN(STV__iter(&stv));
}
AZ(pthread_mutex_unlock(&mtx));
AN(stv);
return (stv);
}
......
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