Fix folly::Singleton to work in dynamically linked binaries
[folly.git] / folly / Singleton.cpp
index 8e9cd99b0763138bd8eb7c61819da5c293a61703..cf1ce727fe31295e47d6f965e87a510126082b34 100644 (file)
@@ -25,6 +25,12 @@ namespace folly {
 
 namespace detail {
 
+// This implementation should always live in .cpp file.
+StaticSingletonManager& StaticSingletonManager::instance() {
+  static StaticSingletonManager* instance = new StaticSingletonManager();
+  return *instance;
+}
+
 constexpr std::chrono::seconds SingletonHolderBase::kDestroyWaitTime;
 
 }