Consistency in namespace-closing comments
[folly.git] / folly / detail / ThreadLocalDetail.h
index fcd1a90f57c5ea0ce76be84b94d6849b9d074f72..a88bfbb1d36a9e8f14b5db9455be3d029093a0d1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016 Facebook, Inc.
+ * Copyright 2017 Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -17,7 +17,6 @@
 #pragma once
 
 #include <limits.h>
-#include <pthread.h>
 
 #include <atomic>
 #include <functional>
@@ -34,6 +33,8 @@
 #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 {
 
 /**
@@ -256,8 +261,8 @@ struct StaticMetaBase {
 
   StaticMetaBase(ThreadEntry* (*threadEntry)(), bool strict);
 
-  ~StaticMetaBase() {
-    LOG(FATAL) << "StaticMeta lives forever!";
+  [[noreturn]] ~StaticMetaBase() {
+    folly::assume_unreachable();
   }
 
   void push_back(ThreadEntry* t) {
@@ -325,7 +330,7 @@ struct StaticMeta : StaticMetaBase {
   static StaticMeta<Tag, AccessMode>& instance() {
     // Leak it on exit, there's only one per process and we don't have to
     // worry about synchronization with exiting threads.
-    static auto instance =
+    /* library-local */ static auto instance =
         detail::createGlobal<StaticMeta<Tag, AccessMode>, void>();
     return *instance;
   }
@@ -392,5 +397,5 @@ struct StaticMeta : StaticMetaBase {
   }
 };
 
-}  // namespace threadlocal_detail
-}  // namespace folly
+} // namespace threadlocal_detail
+} // namespace folly