From d9cc4e4d78d432929c276bd44b0aaff86b65023e Mon Sep 17 00:00:00 2001 From: rpj Date: Fri, 19 Nov 2004 06:35:44 +0000 Subject: Reverse last change. --- pthread_cond_wait.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/pthread_cond_wait.c b/pthread_cond_wait.c index 241f464..1dd12e5 100644 --- a/pthread_cond_wait.c +++ b/pthread_cond_wait.c @@ -9,7 +9,7 @@ * * Pthreads-win32 - POSIX Threads Library for Win32 * Copyright(C) 1998 John E. Bossom - * Copyright(C) 1999,2003 Pthreads-win32 contributors + * Copyright(C) 1999,2004 Pthreads-win32 contributors * * Contact Email: rpj@callisto.canberra.edu.au * @@ -283,17 +283,6 @@ ptw32_cond_wait_cleanup (void *args) int nSignalsWasLeft; int result; - /* - * XSH: Upon successful return, the mutex has been locked and is owned - * by the calling thread. This must be done before any cancelation - * cleanup handlers are run. - */ - if ((result = pthread_mutex_lock (cleanup_args->mutexPtr)) != 0) - { - *resultPtr = result; - return; - } - /* * Whether we got here as a result of signal/broadcast or because of * timeout on wait or thread cancellation we indicate that we are no @@ -351,6 +340,16 @@ ptw32_cond_wait_cleanup (void *args) return; } } + + /* + * XSH: Upon successful return, the mutex has been locked and is owned + * by the calling thread. + */ + if ((result = pthread_mutex_lock (cleanup_args->mutexPtr)) != 0) + { + *resultPtr = result; + return; + } } /* ptw32_cond_wait_cleanup */ static INLINE int -- cgit v1.2.3