X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fthread%2Fpthread_cond_broadcast.c;h=6bfab78f961f7dcd71c40da258065abc0b6bc44d;hb=760f5d7efed4d4761875334f8c4e6398be308cc9;hp=7a023b850bab8c8627ab5d543c5ddc46947d439d;hpb=0b44a0315b47dd8eced9f3b7f31580cf14bbfc01;p=musl diff --git a/src/thread/pthread_cond_broadcast.c b/src/thread/pthread_cond_broadcast.c index 7a023b85..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) { - c->__block = 0; - __wake(&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; }