//
// $Id$
+#ifdef HAVE_CONFIG_H
+# include <simgear_config.h>
+#endif
+
+#include <memory>
#include <simgear/props/props_io.hxx>
+#include <OpenThreads/Mutex>
+#include <OpenThreads/ScopedLock>
+
#include "commands.hxx"
+#include <simgear/math/SGMath.hxx>
+
\f
////////////////////////////////////////////////////////////////////////
// no-op
}
+OpenThreads::Mutex SGCommandMgr::_instanceMutex;
+
+SGCommandMgr*
+SGCommandMgr::instance()
+{
+ static std::auto_ptr<SGCommandMgr> mgr;
+ if (mgr.get())
+ return mgr.get();
+
+ OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_instanceMutex);
+ if (mgr.get())
+ return mgr.get();
+
+ mgr = std::auto_ptr<SGCommandMgr>(new SGCommandMgr);
+ return mgr.get();
+}
+
void
SGCommandMgr::addCommand (const string &name, command_t command)
{