From 45b1b8cb2a6588f9316f780d8cefe11c181a9a17 Mon Sep 17 00:00:00 2001 From: rpj Date: Sat, 16 Oct 2004 02:34:44 +0000 Subject: Mutex speedups cont'd --- pthread_mutex_destroy.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'pthread_mutex_destroy.c') 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 { -- cgit v1.2.3