X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fthread%2Fpthread_cond_broadcast.c;h=6bfab78f961f7dcd71c40da258065abc0b6bc44d;hb=760f5d7efed4d4761875334f8c4e6398be308cc9;hp=dec91164065d844b67b2af27d8994b24e64e2d53;hpb=97c5b5a87c3d9df54278e1073d6177f77536bd32;p=musl diff --git a/src/thread/pthread_cond_broadcast.c b/src/thread/pthread_cond_broadcast.c index dec91164..6bfab78f 100644 --- a/src/thread/pthread_cond_broadcast.c +++ b/src/thread/pthread_cond_broadcast.c @@ -2,7 +2,9 @@ int pthread_cond_broadcast(pthread_cond_t *c) { - a_store(&c->_c_block, 0); - if (c->_c_waiters) __wake(&c->_c_block, -1, 0); + if (!c->_c_shared) return __private_cond_signal(c, -1); + if (!c->_c_waiters) return 0; + a_inc(&c->_c_seq); + __wake(&c->_c_seq, -1, 0); return 0; }