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=28af39fe427ffec8b836f4f30450ffc30b03e5c4;hpb=e882756311c7b06e59fcc8e582f03852b7dcfd30 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; }