summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--condvar.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/condvar.c b/condvar.c
index 2c42c65..ff1332e 100644
--- a/condvar.c
+++ b/condvar.c
@@ -658,7 +658,7 @@ pthread_cond_destroy (pthread_cond_t * cond)
/*
* Check whether cv is still busy (still has waiters)
*/
- if (cv->nWaitersBlocked > cv->nWaitersGone)
+ if (cv->nWaitersBlocked - cv->nWaitersGone - cv->nWaitersUnblocked > 0)
{
if (sem_post(&(cv->semBlockLock)) != 0)
{