X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=simgear%2Fstructure%2Fcommands.cxx;h=16706d96ecde648e8095fdb78cd2674ccbecd086;hb=ff7e70f4d570c472bbc6fe4198483d927914a35e;hp=49a9c63cde0d605c94d73f537a7cc5b95f515126;hpb=2ea2f1b4f29afe7d74e0474ca02874387526e804;p=simgear.git diff --git a/simgear/structure/commands.cxx b/simgear/structure/commands.cxx index 49a9c63c..16706d96 100644 --- a/simgear/structure/commands.cxx +++ b/simgear/structure/commands.cxx @@ -6,8 +6,9 @@ #include #include -#include -#include + +#include +#include #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 guard(lock); + OpenThreads::ScopedLock lock(_instanceMutex); if (mgr.get()) return mgr.get();