X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;ds=sidebyside;f=src%2Fthread%2Fpthread_cond_destroy.c;h=8c5551600e8c35d0a9f5fe194ee060d8303c22f6;hb=8c4be3e2209d2a1d3874b8bc2b474668fcbbbac6;hp=1d21a5a8bfc717d4dff16a229f563f4384493eb8;hpb=0b44a0315b47dd8eced9f3b7f31580cf14bbfc01;p=musl diff --git a/src/thread/pthread_cond_destroy.c b/src/thread/pthread_cond_destroy.c index 1d21a5a8..8c555160 100644 --- a/src/thread/pthread_cond_destroy.c +++ b/src/thread/pthread_cond_destroy.c @@ -2,5 +2,13 @@ int pthread_cond_destroy(pthread_cond_t *c) { + if (c->_c_shared && c->_c_waiters) { + int cnt; + a_or(&c->_c_waiters, 0x80000000); + a_inc(&c->_c_seq); + __wake(&c->_c_seq, -1, 0); + while ((cnt = c->_c_waiters) & 0x7fffffff) + __wait(&c->_c_waiters, 0, cnt, 0); + } return 0; }