X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fthread%2Fpthread_cond_destroy.c;h=a096c5547fdb0297735922568aadbf72c52fa36f;hb=52d4444f8eec1a4e7e0861859c705c3a558b4e2a;hp=1d21a5a8bfc717d4dff16a229f563f4384493eb8;hpb=0b44a0315b47dd8eced9f3b7f31580cf14bbfc01;p=musl 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; }