diff --git a/src/core/singleton/Singleton.h b/src/core/singleton/Singleton.h index 36a7ea5f8149d37744020c0c94f3f427bad59d99..ead687d0c3443b73129b9397e24c644ac0f701a7 100644 --- a/src/core/singleton/Singleton.h +++ b/src/core/singleton/Singleton.h @@ -86,7 +86,8 @@ public: //@{ static const shared_ptr<T>& instance() { - std::lock_guard<std::mutex> lock( instanceMutex_ ); + // this implementation is thread safe + // https://stackoverflow.com/questions/1661529/is-meyers-implementation-of-the-singleton-pattern-thread-safe static shared_ptr<T> object( new T() ); isInstantiated_ = true; return object;