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=5a2e18093725c3965486641f0ad0b61a44f7ed68;hpb=b85fec2ded3f005b877e25b63215c0d09d4a9f7f 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; }