X-Git-Url: http://nsz.repo.hu/git/?p=musl;a=blobdiff_plain;f=src%2Fthread%2Fpthread_cond_destroy.c;h=a096c5547fdb0297735922568aadbf72c52fa36f;hp=1d21a5a8bfc717d4dff16a229f563f4384493eb8;hb=72768ea99e67162b7b42d9cd8917cf9a2c00f1f1;hpb=0b44a0315b47dd8eced9f3b7f31580cf14bbfc01 diff --git a/src/thread/pthread_cond_destroy.c b/src/thread/pthread_cond_destroy.c index 1d21a5a8..a096c554 100644 --- a/src/thread/pthread_cond_destroy.c +++ b/src/thread/pthread_cond_destroy.c @@ -2,5 +2,12 @@ int pthread_cond_destroy(pthread_cond_t *c) { + int priv = c->_c_mutex != (void *)-1; + int cnt; + c->_c_destroy = 1; + if (c->_c_waiters) + __wake(&c->_c_seq, -1, priv); + while ((cnt = c->_c_waiters)) + __wait(&c->_c_waiters, 0, cnt, priv); return 0; }