summaryrefslogtreecommitdiff
path: root/pthread_cond_destroy.c
diff options
context:
space:
mode:
authorrpj <rpj>2007-01-06 13:44:39 +0000
committerrpj <rpj>2007-01-06 13:44:39 +0000
commit35dec51214f692110f441cd68a94cbd264574d18 (patch)
tree1ce9711f604c6799eea806f40b22ce02574b8ae6 /pthread_cond_destroy.c
parenteeef426b8399ad39dfc759352a6e7b0348a047d1 (diff)
See ChangeLog
Diffstat (limited to 'pthread_cond_destroy.c')
-rw-r--r--pthread_cond_destroy.c31
1 files changed, 19 insertions, 12 deletions
diff --git a/pthread_cond_destroy.c b/pthread_cond_destroy.c
index 3d29ffc..53f7a53 100644
--- a/pthread_cond_destroy.c
+++ b/pthread_cond_destroy.c
@@ -135,21 +135,28 @@ pthread_cond_destroy (pthread_cond_t * cond)
* all already signaled waiters to let them retract their
* waiter status - SEE NOTE 1 ABOVE!!!
*/
- if (sem_wait (&(cv->semBlockLock)) != 0)
+ if (ptw32_semwait (&(cv->semBlockLock)) != 0) /* Non-cancelable */
{
- return errno;
+ result = errno;
}
-
- /*
- * !TRY! lock mtxUnblockLock; try will detect busy condition
- * and will not cause a deadlock with respect to concurrent
- * signal/broadcast.
- */
- if ((result = pthread_mutex_trylock (&(cv->mtxUnblockLock))) != 0)
- {
- (void) sem_post (&(cv->semBlockLock));
- return result;
+ else
+ {
+ /*
+ * !TRY! lock mtxUnblockLock; try will detect busy condition
+ * and will not cause a deadlock with respect to concurrent
+ * signal/broadcast.
+ */
+ if ((result = pthread_mutex_trylock (&(cv->mtxUnblockLock))) != 0)
+ {
+ (void) sem_post (&(cv->semBlockLock));
+ }
}
+
+ if (result != 0)
+ {
+ LeaveCriticalSection (&ptw32_cond_list_lock);
+ return result;
+ }
/*
* Check whether cv is still busy (still has waiters)