summaryrefslogtreecommitdiff
path: root/pthread_cond_destroy.c
diff options
context:
space:
mode:
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 9c4a214..79a0020 100644
--- a/pthread_cond_destroy.c
+++ b/pthread_cond_destroy.c
@@ -126,10 +126,10 @@ pthread_cond_destroy (pthread_cond_t * cond)
return EINVAL;
}
- EnterCriticalSection(&ptw32_cond_list_lock);
-
if (*cond != PTHREAD_COND_INITIALIZER)
{
+ EnterCriticalSection(&ptw32_cond_list_lock);
+
cv = *cond;
/*
@@ -207,6 +207,8 @@ pthread_cond_destroy (pthread_cond_t * cond)
(void) free(cv);
}
+
+ LeaveCriticalSection(&ptw32_cond_list_lock);
}
else
{
@@ -240,7 +242,5 @@ 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));
}