From d2b870cd9b6d91261a304e156819571acc309b55 Mon Sep 17 00:00:00 2001 From: rpj Date: Sat, 23 Feb 2002 02:01:11 +0000 Subject: * pthread_cond_destroy.c: Expand the time change critical section to solve deadlock problem. * pthread.c: Add all remaining C modules. * pthread.h: Use dllexport/dllimport attributes on functions to avoid using pthread.def. * sched.h: Likewise. * semaphore.h: Likewise. * GNUmakefile: Add new targets for single translation unit build to maximise inlining potential; generate pthread.def automatically. * Makefile: Likewise, but no longer uses pthread.def. --- pthread_cond_destroy.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'pthread_cond_destroy.c') diff --git a/pthread_cond_destroy.c b/pthread_cond_destroy.c index 5eab110..9c4a214 100644 --- a/pthread_cond_destroy.c +++ b/pthread_cond_destroy.c @@ -126,6 +126,8 @@ pthread_cond_destroy (pthread_cond_t * cond) return EINVAL; } + EnterCriticalSection(&ptw32_cond_list_lock); + if (*cond != PTHREAD_COND_INITIALIZER) { cv = *cond; @@ -168,8 +170,6 @@ pthread_cond_destroy (pthread_cond_t * cond) /* * Now it is safe to destroy */ - EnterCriticalSection(&ptw32_cond_list_lock); - *cond = NULL; if (sem_destroy(&(cv->semBlockLock)) != 0) @@ -205,8 +205,6 @@ pthread_cond_destroy (pthread_cond_t * cond) cv->next->prev = cv->prev; } - LeaveCriticalSection(&ptw32_cond_list_lock); - (void) free(cv); } } @@ -242,5 +240,7 @@ pthread_cond_destroy (pthread_cond_t * cond) LeaveCriticalSection(&ptw32_cond_test_init_lock); } + LeaveCriticalSection(&ptw32_cond_list_lock); + return ((result != 0) ? result : ((result1 != 0) ? result1 : result2)); } -- cgit v1.2.3