summaryrefslogtreecommitdiff
path: root/pthread_mutex_destroy.c
diff options
context:
space:
mode:
authorrpj <rpj>2004-10-16 02:34:44 +0000
committerrpj <rpj>2004-10-16 02:34:44 +0000
commit45b1b8cb2a6588f9316f780d8cefe11c181a9a17 (patch)
tree24753e298d9933d48d764177baf183ef97f04156 /pthread_mutex_destroy.c
parent9da8fdcb33373b4b2e1de2a8b7af3ed4b5811245 (diff)
Mutex speedups cont'd
Diffstat (limited to 'pthread_mutex_destroy.c')
-rw-r--r--pthread_mutex_destroy.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/pthread_mutex_destroy.c b/pthread_mutex_destroy.c
index 1ff9ebe..4b0043a 100644
--- a/pthread_mutex_destroy.c
+++ b/pthread_mutex_destroy.c
@@ -82,8 +82,15 @@ pthread_mutex_destroy (pthread_mutex_t * mutex)
if (result == 0)
{
- (void) sem_destroy (&mx->wait_sema);
- free (mx);
+ if (!CloseHandle (mx->event))
+ {
+ *mutex = mx;
+ result = EINVAL;
+ }
+ else
+ {
+ free (mx);
+ }
}
else
{