diff options
author | Junio C Hamano <gitster@pobox.com> | 2010-06-16 16:21:06 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-06-16 16:21:06 -0700 |
commit | 5c1eba5e312838774afe44bb52885f3cd7e4ac7a (patch) | |
tree | dccf68a10a7a8666720202bcc9ece2ef3138a2b1 /compat | |
parent | 419ff2c575b96555dedac8c736025acfca9f982f (diff) | |
parent | 937491944292fa3303b565b9bd8914c6b644ab13 (diff) | |
download | git-5c1eba5e312838774afe44bb52885f3cd7e4ac7a.tar.gz |
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.h | 8 |
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. |