aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--src/pj_mutex.c6
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 <warmerdam@pobox.com>
+
+ * 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 <warmerdam@pobox.com>
* 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