// should call reenableInstances.
#pragma once
-#include <folly/Baton.h>
#include <folly/Demangle.h>
#include <folly/Exception.h>
#include <folly/Executor.h>
-#include <folly/Hash.h>
#include <folly/Memory.h>
#include <folly/RWSpinLock.h>
#include <folly/Synchronized.h>
#include <folly/detail/StaticSingletonManager.h>
#include <folly/experimental/ReadMostlySharedPtr.h>
+#include <folly/hash/Hash.h>
+#include <folly/synchronization/Baton.h>
#include <algorithm>
#include <atomic>
SingletonHolder(SingletonHolder&&) = delete;
};
-}
+} // namespace detail
class SingletonVault {
public:
*
* Sample usage:
*
- * wangle::IOThreadPoolExecutor executor(max_concurrency_level);
+ * folly::IOThreadPoolExecutor executor(max_concurrency_level);
* folly::Baton<> done;
* doEagerInitVia(executor, &done);
* done.wait(); // or 'timed_wait', or spin with 'try_wait'
// singletons. Create instances of this class in the global scope of
// type Singleton<T> to register your singleton for later access via
// Singleton<T>::try_get().
-template <typename T,
- typename Tag = detail::DefaultTag,
- typename VaultTag = detail::DefaultTag /* for testing */>
+template <
+ typename T,
+ typename Tag = detail::DefaultTag,
+ typename VaultTag = detail::DefaultTag /* for testing */>
class Singleton {
public:
typedef std::function<T*(void)> CreateFunc;
entry.state = State::Living;
}
};
-}
+} // namespace folly
#include <folly/Singleton-inl.h>