summaryrefslogtreecommitdiff
path: root/pthread_cond_wait.c
diff options
context:
space:
mode:
Diffstat (limited to 'pthread_cond_wait.c')
-rw-r--r--pthread_cond_wait.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/pthread_cond_wait.c b/pthread_cond_wait.c
index 57fc978..6db2a48 100644
--- a/pthread_cond_wait.c
+++ b/pthread_cond_wait.c
@@ -301,7 +301,8 @@ ptw32_cond_wait_cleanup (void *args)
}
else if (INT_MAX / 2 == ++(cv->nWaitersGone))
{
- if (sem_wait (&(cv->semBlockLock)) != 0)
+ /* Use the non-cancellable version of sem_wait() */
+ if (ptw32_semwait (&(cv->semBlockLock)) != 0)
{
*resultPtr = errno;
/*
@@ -382,6 +383,7 @@ ptw32_cond_timedwait (pthread_cond_t * cond,
cv = *cond;
+ /* Thread can be cancelled in sem_wait() but this is OK */
if (sem_wait (&(cv->semBlockLock)) != 0)
{
return errno;