X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fthread%2Fpthread_cond_broadcast.c;h=69f840fb4faee7d1f402771dba6f02b157a935c5;hb=234c58467c3709bafdd3ffa6ac73655e1dfd9ddb;hp=7a023b850bab8c8627ab5d543c5ddc46947d439d;hpb=0b44a0315b47dd8eced9f3b7f31580cf14bbfc01;p=musl diff --git a/src/thread/pthread_cond_broadcast.c b/src/thread/pthread_cond_broadcast.c index 7a023b85..69f840fb 100644 --- a/src/thread/pthread_cond_broadcast.c +++ b/src/thread/pthread_cond_broadcast.c @@ -1,8 +1,12 @@ #include "pthread_impl.h" +int __private_cond_signal(pthread_cond_t *, int); + 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; }