From 9c3e3be04ca23b73e4a9eecce8019e65f76cdf5d Mon Sep 17 00:00:00 2001 From: Andrii Grynenko Date: Tue, 23 Feb 2016 14:56:29 -0800 Subject: [PATCH] Fix SIOF in folly/io/async/Request.cpp Summary: Use Meyers singleton instead. Reviewed By: afrind Differential Revision: D2963282 fb-gh-sync-id: 7aec36e7cc3b0ab09b2b093202f40d5b0d399f4d shipit-source-id: 7aec36e7cc3b0ab09b2b093202f40d5b0d399f4d --- folly/io/async/Request.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/folly/io/async/Request.cpp b/folly/io/async/Request.cpp index 7a048a35..d2d17ca7 100644 --- a/folly/io/async/Request.cpp +++ b/folly/io/async/Request.cpp @@ -22,13 +22,10 @@ namespace folly { -namespace { - -using SingletonT = SingletonThreadLocal>; -SingletonT singleton; -} - std::shared_ptr& RequestContext::getStaticContext() { + using SingletonT = SingletonThreadLocal>; + static SingletonT singleton; + return singleton.get(); } } -- 2.34.1