Disallow folly::Singletons before main()
authorAndrii Grynenko <andrii@fb.com>
Tue, 29 Nov 2016 23:34:43 +0000 (15:34 -0800)
committerFacebook Github Bot <facebook-github-bot-bot@fb.com>
Tue, 29 Nov 2016 23:38:29 +0000 (15:38 -0800)
commitee43735cc06a4243e6676b332035927715643be7
treee25c64a02140cc80ca3f6b1ea7ac686a97760289
parent9c5b3564fc8807a0affda3e3957d7a03dd0f4daf
Disallow folly::Singletons before main()

Summary:
Make folly::Singleton fail if singleton is requested before registrationComplete. By doing this we disallow any folly::Singleton to be created before main().

Strict mode is still disabled for Python and Hs.

Reviewed By: yfeldblum

Differential Revision: D4121322

fbshipit-source-id: b66c23e24f6a7324cd12ddb77cad960e0950a1aa
folly/Singleton-inl.h
folly/Singleton.cpp
folly/Singleton.h
folly/test/SingletonTest.cpp