]> git.mxchange.org Git - simgear.git/commitdiff
Fix non threadsafe code
authorfredb <fredb>
Sun, 1 Jun 2008 17:25:05 +0000 (17:25 +0000)
committerfredb <fredb>
Sun, 1 Jun 2008 17:25:05 +0000 (17:25 +0000)
simgear/scene/util/SGSceneFeatures.cxx

index ccefab957fa17adb0b6eb66213b1d8553f8d6923..71edb2ebbda525cdcb9aab551e77fed719508da6 100644 (file)
@@ -44,14 +44,14 @@ SGSceneFeatures::SGSceneFeatures() :
 {
 }
 
+static SGMutex mutexSGSceneFeatures_instance;
 SGSceneFeatures*
 SGSceneFeatures::instance()
 {
   static SGSharedPtr<SGSceneFeatures> sceneFeatures;
   if (sceneFeatures)
     return sceneFeatures;
-  static SGMutex mutex;
-  SGGuard<SGMutex> guard(mutex);
+  SGGuard<SGMutex> guard(mutexSGSceneFeatures_instance);
   if (sceneFeatures)
     return sceneFeatures;
   sceneFeatures = new SGSceneFeatures;