]> git.mxchange.org Git - simgear.git/blobdiff - simgear/structure/commands.cxx
Merge branch 'topic/gcintersect' into next
[simgear.git] / simgear / structure / commands.cxx
index 49a9c63cde0d605c94d73f537a7cc5b95f515126..16706d96ecde648e8095fdb78cd2674ccbecd086 100644 (file)
@@ -6,8 +6,9 @@
 
 #include <memory>
 #include <simgear/props/props_io.hxx>
-#include <simgear/threads/SGThread.hxx>
-#include <simgear/threads/SGGuard.hxx>
+
+#include <OpenThreads/Mutex>
+#include <OpenThreads/ScopedLock>
 
 #include "commands.hxx"
 
@@ -28,6 +29,8 @@ SGCommandMgr::~SGCommandMgr ()
   // no-op
 }
 
+OpenThreads::Mutex SGCommandMgr::_instanceMutex;
+
 SGCommandMgr*
 SGCommandMgr::instance()
 {
@@ -35,8 +38,7 @@ SGCommandMgr::instance()
   if (mgr.get())
     return mgr.get();
 
-  static SGMutex lock;
-  SGGuard<SGMutex> guard(lock);
+  OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_instanceMutex);
   if (mgr.get())
     return mgr.get();