summaryrefslogtreecommitdiff
path: root/compat
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-05-21 04:02:16 -0700
committerJunio C Hamano <gitster@pobox.com>2010-05-21 04:02:16 -0700
commitea5f75a64ae52590b06713d45d84de03ca109ccc (patch)
tree3d7e604cb897afd9b8bcf7ed413e86d193cab40a /compat
parentaf655431f53c20e3d0ed236544397c69974267f4 (diff)
parent937491944292fa3303b565b9bd8914c6b644ab13 (diff)
downloadgit-ea5f75a64ae52590b06713d45d84de03ca109ccc.tar.gz
Merge branch 'np/malloc-threading'
* np/malloc-threading: Thread-safe xmalloc and xrealloc needs a recursive mutex Make xmalloc and xrealloc thread-safe
Diffstat (limited to 'compat')
-rw-r--r--compat/win32/pthread.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/compat/win32/pthread.h b/compat/win32/pthread.h
index c72f100f40..a45f8d66df 100644
--- a/compat/win32/pthread.h
+++ b/compat/win32/pthread.h
@@ -18,11 +18,17 @@
*/
#define pthread_mutex_t CRITICAL_SECTION
-#define pthread_mutex_init(a,b) InitializeCriticalSection((a))
+#define pthread_mutex_init(a,b) (InitializeCriticalSection((a)), 0)
#define pthread_mutex_destroy(a) DeleteCriticalSection((a))
#define pthread_mutex_lock EnterCriticalSection
#define pthread_mutex_unlock LeaveCriticalSection
+typedef int pthread_mutexattr_t;
+#define pthread_mutexattr_init(a) (*(a) = 0)
+#define pthread_mutexattr_destroy(a) do {} while (0)
+#define pthread_mutexattr_settype(a, t) 0
+#define PTHREAD_MUTEX_RECURSIVE 0
+
/*
* Implement simple condition variable for Windows threads, based on ACE
* implementation.