diff options
Diffstat (limited to 'pthread_cond_destroy.c')
-rw-r--r-- | pthread_cond_destroy.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pthread_cond_destroy.c b/pthread_cond_destroy.c index f5102ac..5eab110 100644 --- a/pthread_cond_destroy.c +++ b/pthread_cond_destroy.c @@ -168,6 +168,8 @@ 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) @@ -185,8 +187,6 @@ pthread_cond_destroy (pthread_cond_t * cond) /* Unlink the CV from the list */ - EnterCriticalSection(&ptw32_cond_list_lock); - if (ptw32_cond_list_head == cv) { ptw32_cond_list_head = cv->next; |