summaryrefslogtreecommitdiff
path: root/compat
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-06-16 23:21:06 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-06-16 23:21:06 (GMT)
commit5c1eba5e312838774afe44bb52885f3cd7e4ac7a (patch)
treedccf68a10a7a8666720202bcc9ece2ef3138a2b1 /compat
parent419ff2c575b96555dedac8c736025acfca9f982f (diff)
parent937491944292fa3303b565b9bd8914c6b644ab13 (diff)
downloadgit-5c1eba5e312838774afe44bb52885f3cd7e4ac7a.zip
git-5c1eba5e312838774afe44bb52885f3cd7e4ac7a.tar.gz
git-5c1eba5e312838774afe44bb52885f3cd7e4ac7a.tar.bz2
Merge branch 'np/malloc-threading' into maint
* 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 c72f100..a45f8d6 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.