Commit 5fd309ec authored by Dridi Boukelmoune's avatar Dridi Boukelmoune Committed by Lasse Karstensen

Barriers can only be created on the top thread

This is similar ASSERT_CLI, in order to make socket barriers creation
thread-safe.
parent 4b48aaf9
......@@ -70,6 +70,9 @@ barrier_new(char *name, struct vtclog *vl)
AN(name);
if (*name != 'b')
vtc_log(vl, 0, "Barrier name must start with 'b' (%s)", name);
if (pthread_self() != vtc_thread)
vtc_log(vl, 0,
"Barrier %s can only be created on the top thread", name);
REPLACE(b->name, name);
AZ(pthread_mutex_init(&b->mtx, NULL));
......
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