Commit 97c7ab42 authored by Maged Michael's avatar Maged Michael Committed by Facebook Github Bot

hazptr: rename start_hazptr_thread_pool_executor to enable_hazptr_thread_pool_executor

Summary: This makes the function name more accurate. The function does not start the thread pool executor. It only enables the construction and use of a thread pool executor by the default hazptr domain when needed.

Reviewed By: davidtgoldblatt

Differential Revision: D19852860

fbshipit-source-id: 5ae71d0fd2d2d20c9ca66f45d57e90085703b3fb
parent 47696430
...@@ -65,7 +65,7 @@ void init(int* argc, char*** argv, bool removeFlags) { ...@@ -65,7 +65,7 @@ void init(int* argc, char*** argv, bool removeFlags) {
#endif #endif
// Set the default hazard pointer domain to use a thread pool executor // Set the default hazard pointer domain to use a thread pool executor
// for asynchronous reclamation // for asynchronous reclamation
folly::start_hazptr_thread_pool_executor(); folly::enable_hazptr_thread_pool_executor();
} }
Init::Init(int* argc, char*** argv, bool removeFlags) { Init::Init(int* argc, char*** argv, bool removeFlags) {
......
...@@ -35,7 +35,7 @@ folly::Executor* get_hazptr_tpe() { ...@@ -35,7 +35,7 @@ folly::Executor* get_hazptr_tpe() {
namespace folly { namespace folly {
void start_hazptr_thread_pool_executor() { void enable_hazptr_thread_pool_executor() {
if (FLAGS_folly_hazptr_use_executor) { if (FLAGS_folly_hazptr_use_executor) {
default_hazptr_domain().set_executor(&get_hazptr_tpe); default_hazptr_domain().set_executor(&get_hazptr_tpe);
} }
......
...@@ -20,6 +20,6 @@ ...@@ -20,6 +20,6 @@
namespace folly { namespace folly {
void start_hazptr_thread_pool_executor(); void enable_hazptr_thread_pool_executor();
} // namespace folly } // namespace folly
...@@ -900,7 +900,7 @@ void recursive_destruction_test() { ...@@ -900,7 +900,7 @@ void recursive_destruction_test() {
} }
void fork_test() { void fork_test() {
folly::start_hazptr_thread_pool_executor(); folly::enable_hazptr_thread_pool_executor();
auto trigger_reclamation = [] { auto trigger_reclamation = [] {
hazptr_obj_cohort b; hazptr_obj_cohort b;
for (int i = 0; i < 2001; ++i) { for (int i = 0; i < 2001; ++i) {
......
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