From e1be06bbbbce24f70ba536a40022e24d94b96ad3 Mon Sep 17 00:00:00 2001 From: olsner Date: Thu, 13 Nov 2003 16:25:32 +0000 Subject: [PATCH] PTHREAD_MUTEX_INITIALIZER This was SVN commit r59. --- source/lib/posix.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/source/lib/posix.cpp b/source/lib/posix.cpp index 66f7be2bb5..3c9ac5f927 100755 --- a/source/lib/posix.cpp +++ b/source/lib/posix.cpp @@ -271,12 +271,16 @@ static HANDLE m2h(pthread_mutex_t* m) return h; } +pthread_mutex_t pthread_mutex_initializer() +{ + return CreateMutex(0, 0, 0); +} + int pthread_mutex_init(pthread_mutex_t* m, const pthread_mutexattr_t*) { if(!m) return -1; - HANDLE h = CreateMutex(0, 0, 0); - *m = ((char*)h - (char*)0); + *m = pthread_mutex_initializer(); return 0; }