X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fthread%2Fpthread_cond_broadcast.c;h=30f7f6df6984bf403694e78d73ebd5a563ba4976;hb=d5fd1fa48564a5528f53e5b1cab5063a0545d7f7;hp=1d378c0b271b0420044a5dc842eba04f6c3887e0;hpb=e882756311c7b06e59fcc8e582f03852b7dcfd30;p=musl 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; }