Skip to content
Snippets Groups Projects
Commit eb70b9e0 authored by ncteisen's avatar ncteisen
Browse files

Anon namespace over static

parent a5d557b9
No related branches found
No related tags found
No related merge requests found
...@@ -23,14 +23,17 @@ ...@@ -23,14 +23,17 @@
#ifndef GRPC_CUSTOM_DEFAULT_THREAD_POOL #ifndef GRPC_CUSTOM_DEFAULT_THREAD_POOL
namespace grpc { namespace grpc {
namespace {
static ThreadPoolInterface* CreateDefaultThreadPoolImpl() { ThreadPoolInterface* CreateDefaultThreadPoolImpl() {
int cores = gpr_cpu_num_cores(); int cores = gpr_cpu_num_cores();
if (!cores) cores = 4; if (!cores) cores = 4;
return new DynamicThreadPool(cores); return new DynamicThreadPool(cores);
} }
static CreateThreadPoolFunc g_ctp_impl = CreateDefaultThreadPoolImpl; CreateThreadPoolFunc g_ctp_impl = CreateDefaultThreadPoolImpl;
} // namespace
ThreadPoolInterface* CreateDefaultThreadPool() { return g_ctp_impl(); } ThreadPoolInterface* CreateDefaultThreadPool() { return g_ctp_impl(); }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment