X-Git-Url: http://nsz.repo.hu/git/?p=musl;a=blobdiff_plain;f=src%2Fthread%2Fpthread_cond_broadcast.c;h=30f7f6df6984bf403694e78d73ebd5a563ba4976;hp=1d378c0b271b0420044a5dc842eba04f6c3887e0;hb=140778582487fb082716eec74324d7b16beb2daf;hpb=cdfb725ca3e20e14c64ca8695496e430b89b3b2c diff --git a/src/thread/pthread_cond_broadcast.c b/src/thread/pthread_cond_broadcast.c index 1d378c0b..30f7f6df 100644 --- a/src/thread/pthread_cond_broadcast.c +++ b/src/thread/pthread_cond_broadcast.c @@ -2,7 +2,7 @@ int pthread_cond_broadcast(pthread_cond_t *c) { - c->_c_block = 0; - __wake(&c->_c_block, -1, 0); + if (a_swap(&c->_c_block, 0)) + __wake(&c->_c_block, -1, 0); return 0; }