From 35dec51214f692110f441cd68a94cbd264574d18 Mon Sep 17 00:00:00 2001 From: rpj Date: Sat, 6 Jan 2007 13:44:39 +0000 Subject: See ChangeLog --- pthread_cond_destroy.c | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) (limited to 'pthread_cond_destroy.c') 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) -- cgit v1.2.3