From eb70b9e0df3b51db4e2d3466607e7713425dfac7 Mon Sep 17 00:00:00 2001 From: ncteisen <ncteisen@gmail.com> Date: Thu, 6 Jul 2017 09:38:26 -0700 Subject: [PATCH] Anon namespace over static --- src/cpp/server/create_default_thread_pool.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/cpp/server/create_default_thread_pool.cc b/src/cpp/server/create_default_thread_pool.cc index 57faa17f6b..8ca3e32c2f 100644 --- a/src/cpp/server/create_default_thread_pool.cc +++ b/src/cpp/server/create_default_thread_pool.cc @@ -23,14 +23,17 @@ #ifndef GRPC_CUSTOM_DEFAULT_THREAD_POOL namespace grpc { +namespace { -static ThreadPoolInterface* CreateDefaultThreadPoolImpl() { +ThreadPoolInterface* CreateDefaultThreadPoolImpl() { int cores = gpr_cpu_num_cores(); if (!cores) cores = 4; return new DynamicThreadPool(cores); } -static CreateThreadPoolFunc g_ctp_impl = CreateDefaultThreadPoolImpl; +CreateThreadPoolFunc g_ctp_impl = CreateDefaultThreadPoolImpl; + +} // namespace ThreadPoolInterface* CreateDefaultThreadPool() { return g_ctp_impl(); } -- GitLab