From: fredb Date: Sun, 1 Jun 2008 17:25:05 +0000 (+0000) Subject: Fix non threadsafe code X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=1a498348ee6d14be3e798714211970fe671ddf9f;p=simgear.git Fix non threadsafe code --- diff --git a/simgear/scene/util/SGSceneFeatures.cxx b/simgear/scene/util/SGSceneFeatures.cxx index ccefab95..71edb2eb 100644 --- a/simgear/scene/util/SGSceneFeatures.cxx +++ b/simgear/scene/util/SGSceneFeatures.cxx @@ -44,14 +44,14 @@ SGSceneFeatures::SGSceneFeatures() : { } +static SGMutex mutexSGSceneFeatures_instance; SGSceneFeatures* SGSceneFeatures::instance() { static SGSharedPtr sceneFeatures; if (sceneFeatures) return sceneFeatures; - static SGMutex mutex; - SGGuard guard(mutex); + SGGuard guard(mutexSGSceneFeatures_instance); if (sceneFeatures) return sceneFeatures; sceneFeatures = new SGSceneFeatures;