[GRASS-SVN] r37162 - grass/trunk/lib/gis

svn_grass at osgeo.org svn_grass at osgeo.org
Mon May 11 10:33:55 EDT 2009


Author: glynn
Date: 2009-05-11 10:33:55 -0400 (Mon, 11 May 2009)
New Revision: 37162

Modified:
   grass/trunk/lib/gis/counter.c
Log:
Fix G_is_initialized() for case of concurrent initialisation attempts


Modified: grass/trunk/lib/gis/counter.c
===================================================================
--- grass/trunk/lib/gis/counter.c	2009-05-11 09:37:15 UTC (rev 37161)
+++ grass/trunk/lib/gis/counter.c	2009-05-11 14:33:55 UTC (rev 37162)
@@ -64,6 +64,11 @@
 #ifdef HAVE_PTHREAD_H
     make_mutex();
     pthread_mutex_lock(&mutex);
+
+    if (*p) {
+	pthread_mutex_unlock(&mutex);
+	return 1;
+    }
 #endif
     return 0;
 }



More information about the grass-commit mailing list