]> git.mxchange.org Git - simgear.git/blobdiff - simgear/scene/tgdb/pt_lights.cxx
Replace SG_USE_STD() by using std::
[simgear.git] / simgear / scene / tgdb / pt_lights.cxx
index e5c9a19cd6504daa2d404c6f4b983efa9728efa0..274a4e1873054e609192e9b7f8bd157e4e97be45 100644 (file)
 
 #include <osgUtil/CullVisitor>
 
+#include <OpenThreads/Mutex>
+#include <OpenThreads/ScopedLock>
+
 #include <simgear/math/sg_random.h>
 #include <simgear/debug/logstream.hxx>
-#include <simgear/threads/SGThread.hxx>
-#include <simgear/threads/SGGuard.hxx>
 #include <simgear/scene/util/RenderConstants.hxx>
 #include <simgear/scene/util/SGEnlargeBoundingBox.hxx>
 
 #include "SGVasiDrawable.hxx"
 
+using OpenThreads::Mutex;
+using OpenThreads::ScopedLock;
+
 using namespace simgear;
 
 static void
@@ -123,6 +127,8 @@ getPointSpriteImage(int logResolution)
   return image;
 }
 
+static Mutex lightMutex;
+
 static osg::Texture2D*
 gen_standard_light_sprite(void)
 {
@@ -131,8 +137,7 @@ gen_standard_light_sprite(void)
   if (texture.valid())
     return texture.get();
   
-  static SGMutex mutex;
-  SGGuard<SGMutex> guard(mutex);
+  ScopedLock<Mutex> lock(lightMutex);
   if (texture.valid())
     return texture.get();