Commit 2e32138d authored by Pranjal Raihan's avatar Pranjal Raihan Committed by Facebook GitHub Bot

Use thread_local instead of FOLLY_TLS in folly::observer

Summary:
`FOLLY_TLS` is explicitly disabled for 32-bit iOS. Perhaps because old iOS versions did not support `__thread`.

`thread_local` is standard C++11, appears to be supported by the iOS 32-bit build, and is also used in multiple places around folly already.

Differential Revision: D25287484

fbshipit-source-id: 2e81e275e0f1cba7bcf5239fe34d4b5eb8add6d0
parent 2ae32be7
...@@ -29,8 +29,8 @@ ...@@ -29,8 +29,8 @@
namespace folly { namespace folly {
namespace observer_detail { namespace observer_detail {
FOLLY_TLS bool ObserverManager::inManagerThread_{false}; thread_local bool ObserverManager::inManagerThread_{false};
FOLLY_TLS ObserverManager::DependencyRecorder::Dependencies* thread_local ObserverManager::DependencyRecorder::Dependencies*
ObserverManager::DependencyRecorder::currentDependencies_{nullptr}; ObserverManager::DependencyRecorder::currentDependencies_{nullptr};
DEFINE_int32( DEFINE_int32(
......
...@@ -170,7 +170,7 @@ class ObserverManager { ...@@ -170,7 +170,7 @@ class ObserverManager {
Dependencies dependencies_; Dependencies dependencies_;
Dependencies* previousDepedencies_; Dependencies* previousDepedencies_;
static FOLLY_TLS Dependencies* currentDependencies_; static thread_local Dependencies* currentDependencies_;
}; };
private: private:
...@@ -195,7 +195,7 @@ class ObserverManager { ...@@ -195,7 +195,7 @@ class ObserverManager {
static ObserverManager& getInstance(); static ObserverManager& getInstance();
static std::shared_ptr<UpdatesManager> getUpdatesManager(); static std::shared_ptr<UpdatesManager> getUpdatesManager();
static FOLLY_TLS bool inManagerThread_; static thread_local bool inManagerThread_;
/** /**
* Version mutex is used to make sure all updates are processed from the * Version mutex is used to make sure all updates are processed from the
......
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