From: Andrew Gallagher Date: Wed, 26 Oct 2016 08:24:23 +0000 (-0700) Subject: Move inline functions with static-locals to implementation files X-Git-Tag: v2016.10.31.00~5 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=e4431011e41842cf1f7e0f3ac1eba097568a1a56;p=folly.git Move inline functions with static-locals to implementation files Summary: This refactors inline functions defined in headers which had static locals so that their definition is moved to the corresponding implementation file. Reviewed By: yfeldblum Differential Revision: D4049175 fbshipit-source-id: 56eeb82eb23b04c3b9940d803d05050949aa5ef9 --- diff --git a/folly/experimental/RCUUtils.cpp b/folly/experimental/RCUUtils.cpp index 782bb05b..48ae846a 100644 --- a/folly/experimental/RCUUtils.cpp +++ b/folly/experimental/RCUUtils.cpp @@ -49,4 +49,10 @@ bool RCURegisterThread() { return ret; } +RCUReadLock& RCUReadLock::instance() { + // Both lock and unlock are static, so no need to worry about destruction + // order + static RCUReadLock instance; + return instance; +} } diff --git a/folly/experimental/RCUUtils.h b/folly/experimental/RCUUtils.h index 74cc788f..21b22525 100644 --- a/folly/experimental/RCUUtils.h +++ b/folly/experimental/RCUUtils.h @@ -30,12 +30,7 @@ bool RCURegisterThread(); class RCUReadLock { public: - static RCUReadLock& instance() { - // Both lock and unlock are static, so no need to worry about destruction - // order - static RCUReadLock instance; - return instance; - } + static RCUReadLock& instance(); static void lock() { assert(RCURegisterThread() == false);