From c2525b5c8843ee08c7300ad808076c6287eef7b4 Mon Sep 17 00:00:00 2001 From: Frank Warmerdam Date: Sun, 28 Mar 2010 22:13:28 +0000 Subject: correct mutex creation on win32 to be in unlocked state (#63) git-svn-id: http://svn.osgeo.org/metacrs/proj/branches/4.7@1832 4e78687f-474d-0410-85f9-8d5e500ac6b2 --- ChangeLog | 5 +++++ src/pj_mutex.c | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index e1657f64..937b30bf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2010-01-25 Frank Warmerdam + + * src/pj_mutex.c: fix creation of mutex on win32 to be in + unacquired state in pj_init_lock to avoid an extra reference. (#63) + 2009-09-24 Frank Warmerdam * nad/Makefile.am: add ntv2 and ignf testing if grid shift files diff --git a/src/pj_mutex.c b/src/pj_mutex.c index 60d6fc74..3399ac12 100644 --- a/src/pj_mutex.c +++ b/src/pj_mutex.c @@ -181,8 +181,8 @@ void pj_release_lock() { if( mutex_lock == NULL ) pj_init_lock(); - - ReleaseMutex( mutex_lock ); + else + ReleaseMutex( mutex_lock ); } /************************************************************************/ @@ -205,7 +205,7 @@ static void pj_init_lock() { if( mutex_lock == NULL ) - mutex_lock = CreateMutex( NULL, TRUE, NULL ); + mutex_lock = CreateMutex( NULL, FALSE, NULL ); } #endif // def MUTEX_win32 -- cgit v1.2.3