diff options
Diffstat (limited to 'pthread_mutex_destroy.c')
-rw-r--r-- | pthread_mutex_destroy.c | 11 |
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 { |