X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;ds=sidebyside;f=folly%2FSingleton.h;h=921c443ab3eeca0ff200894cedb82a8720aba1aa;hb=4cbf7a642550f823e34eee832ffd9052f148864d;hp=64b6f37592580359c5124c46a0107706a545534b;hpb=7f15a179e20b0d61bfb5e872956993b0c6afaa30;p=folly.git diff --git a/folly/Singleton.h b/folly/Singleton.h index 64b6f375..921c443a 100644 --- a/folly/Singleton.h +++ b/folly/Singleton.h @@ -121,16 +121,16 @@ // should call reenableInstances. #pragma once -#include #include #include #include -#include #include #include #include #include #include +#include +#include #include #include @@ -328,7 +328,7 @@ struct SingletonHolder : public SingletonHolderBase { SingletonHolder(SingletonHolder&&) = delete; }; -} +} // namespace detail class SingletonVault { public: @@ -405,10 +405,10 @@ class SingletonVault { * * 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' + * done.wait(); // or 'try_wait_for', etc. * */ void doEagerInitVia(Executor& exe, folly::Baton<>* done = nullptr); @@ -532,9 +532,10 @@ class SingletonVault { // singletons. Create instances of this class in the global scope of // type Singleton to register your singleton for later access via // Singleton::try_get(). -template +template < + typename T, + typename Tag = detail::DefaultTag, + typename VaultTag = detail::DefaultTag /* for testing */> class Singleton { public: typedef std::function CreateFunc; @@ -733,6 +734,6 @@ class LeakySingleton { entry.state = State::Living; } }; -} +} // namespace folly #include