X-Git-Url: http://nsz.repo.hu/git/?p=musl;a=blobdiff_plain;f=src%2Fthread%2Fpthread_cond_broadcast.c;h=848e288f5ea6dc25de38b901210bbace6f2bc2de;hp=bf6de048c1f83a7ef708964deb42a1cc9d9c6419;hb=8c0a3d9e5c169fc9d0f246ab59362b658b029ad7;hpb=729d6368bdf9faa33299cdfa68efc7422af33bd7 diff --git a/src/thread/pthread_cond_broadcast.c b/src/thread/pthread_cond_broadcast.c index bf6de048..848e288f 100644 --- a/src/thread/pthread_cond_broadcast.c +++ b/src/thread/pthread_cond_broadcast.c @@ -22,8 +22,8 @@ int pthread_cond_broadcast(pthread_cond_t *c) m = c->_c_mutex; /* Move waiter count to the mutex */ - a_fetch_add(&m->_m_waiters, c->_c_waiters); - a_store(&c->_c_waiters, 0); + a_fetch_add(&m->_m_waiters, c->_c_waiters2); + c->_c_waiters2 = 0; /* Perform the futex requeue, waking one waiter unless we know * that the calling thread holds the mutex. */