Commit d4ec31ab authored by Yedidya Feldblum's avatar Yedidya Feldblum Committed by Facebook Github Bot

Fix SingletonThreadLocal use from headers

Summary:
[Folly] Fix `SingletonThreadLocal` use from headers included by separate dynamically-loaded modules.

There is no need in `SingletonThreadLocal` specifically to check for double-registration and `SingletonThreadLocal` does not support mocks, so `LeakySingleton` may be bypassed entirely.

Reviewed By: djwatson

Differential Revision: D7283390

fbshipit-source-id: 45295c4dab233b9373ed32a47d4c80832b0f9eff
parent b07974cc
......@@ -97,8 +97,9 @@ class SingletonThreadLocal {
};
FOLLY_EXPORT FOLLY_ALWAYS_INLINE static Wrapper& getWrapperInline() {
static LeakySingleton<ThreadLocal<Wrapper>, Tag> singleton;
return *singleton.get();
/* library-local */ static auto entry =
detail::createGlobal<ThreadLocal<Wrapper>, Tag>();
return **entry;
}
FOLLY_NOINLINE static Wrapper& getWrapperOutline() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment