Don't throw in Singleton::get() if singleton is alive
Summary:
This is a fix for situations where you know that something is keeping singleton alive (by getting a weak_ptr and locking it), and request a singleton instance via get() method (if e.g. it's hard to pass a pointer to singleton instance from a method which locked it). If shutdown was scheduled - an exception was previously thrown even though the object was not destroyed yet.
This simplifies conversion of legacy code to folly::Singleton.
Test Plan:
fbconfig -r gatehouse/usersets/tests
fbmake runtests
Reviewed By: chip@fb.com
Subscribers: trunkagent, njormrod
FB internal diff:
D1619311