summaryrefslogtreecommitdiff
path: root/pthread_cond_destroy.c
diff options
context:
space:
mode:
authorrpj <rpj>2002-02-23 02:01:11 +0000
committerrpj <rpj>2002-02-23 02:01:11 +0000
commitd2b870cd9b6d91261a304e156819571acc309b55 (patch)
tree4b56dbc20070a24a90c123daadc35ab628f21e8c /pthread_cond_destroy.c
parent09cf57ffcf96b3f0cf7d5ec959c455ba54245a65 (diff)
* 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.
Diffstat (limited to 'pthread_cond_destroy.c')
-rw-r--r--pthread_cond_destroy.c8
1 files changed, 4 insertions, 4 deletions
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));
}