Resolve the circular dependency between ThreadLocalDetail and ThreadLocal
authorChristopher Dykes <cdykes@fb.com>
Mon, 26 Jun 2017 18:42:42 +0000 (11:42 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Mon, 26 Jun 2017 18:50:39 +0000 (11:50 -0700)
Summary: There was a circular dependency between the `detail/ThreadLocalDetail.(cpp|h)` files and `ThreadLocal.(cpp|h)`, this resolves that circular dependency by moving a couple of declarations into the detail file.

Reviewed By: yfeldblum

Differential Revision: D5318875

fbshipit-source-id: 61de7c4b3ffa30f9eb11bd97e0493e9de12c5804

folly/ThreadLocal.h
folly/detail/ThreadLocalDetail.cpp
folly/detail/ThreadLocalDetail.h

index 3565c21..d67f3b8 100644 (file)
 #include <folly/Portability.h>
 #include <folly/ScopeGuard.h>
 #include <folly/SharedMutex.h>
+#include <folly/detail/ThreadLocalDetail.h>
 #include <type_traits>
 #include <utility>
 
-namespace folly {
-enum class TLPDestructionMode {
-  THIS_THREAD,
-  ALL_THREADS
-};
-struct AccessModeStrict {};
-}  // namespace
-
-#include <folly/detail/ThreadLocalDetail.h>
-
 namespace folly {
 
 template <class T, class Tag, class AccessMode>
index 67eb056..4c03646 100644 (file)
@@ -13,7 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#include <folly/ThreadLocal.h>
+#include <folly/detail/ThreadLocalDetail.h>
 
 #include <list>
 #include <mutex>
index 9c86385..fe72161 100644 (file)
@@ -33,6 +33,7 @@
 #include <folly/MicroSpinLock.h>
 #include <folly/Portability.h>
 #include <folly/ScopeGuard.h>
+#include <folly/SharedMutex.h>
 #include <folly/portability/PThread.h>
 
 #include <folly/detail/StaticSingletonManager.h>
 #endif
 
 namespace folly {
+
+enum class TLPDestructionMode { THIS_THREAD, ALL_THREADS };
+struct AccessModeStrict {};
+
 namespace threadlocal_detail {
 
 /**