Commit f26f2b80a7af60d2f81957d0b4933c932793d3f8

Vicent Martí 2011-05-08T13:56:09

Merge pull request #177 from kellypleahy/topic/fix-delete-mutex Fix bug in the way pthead_mutex_t was being destroyed in win32.

diff --git a/src/win32/pthread.c b/src/win32/pthread.c
index f47364a..7e17b6b 100644
--- a/src/win32/pthread.c
+++ b/src/win32/pthread.c
@@ -48,16 +48,15 @@ int pthread_join(pthread_t thread, void **value_ptr)
 int pthread_mutex_init(pthread_mutex_t *GIT_RESTRICT mutex,
                        const pthread_mutexattr_t *GIT_RESTRICT GIT_UNUSED(mutexattr))
 {
-	GIT_UNUSED_ARG(mutexattr);
+    GIT_UNUSED_ARG(mutexattr);
     InitializeCriticalSection(mutex);
     return 0;
 }
 
 int pthread_mutex_destroy(pthread_mutex_t *mutex)
 {
-    int ret;
-    ret = CloseHandle(mutex);
-    return -(!ret);
+    DeleteCriticalSection(mutex);
+    return 0;
 }
 
 int pthread_mutex_lock(pthread_mutex_t *mutex)