X-Git-Url: http://nsz.repo.hu/git/?p=musl;a=blobdiff_plain;f=src%2Fthread%2Fpthread_cond_broadcast.c;fp=src%2Fthread%2Fpthread_cond_broadcast.c;h=6002c53507be55152328caacd3394614daa0dffd;hp=30f7f6df6984bf403694e78d73ebd5a563ba4976;hb=4b153ac42428447a148e6da543ebe6df017078db;hpb=2eff02e4a032323a45541c79967638d8c77d79e4 diff --git a/src/thread/pthread_cond_broadcast.c b/src/thread/pthread_cond_broadcast.c index 30f7f6df..6002c535 100644 --- a/src/thread/pthread_cond_broadcast.c +++ b/src/thread/pthread_cond_broadcast.c @@ -2,7 +2,8 @@ int pthread_cond_broadcast(pthread_cond_t *c) { - if (a_swap(&c->_c_block, 0)) + int w = c->_c_waiters; + if (a_swap(&c->_c_block, 0) || w) __wake(&c->_c_block, -1, 0); return 0; }