aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar ncteisen <ncteisen@gmail.com>2017-07-05 15:52:28 -0700
committerGravatar ncteisen <ncteisen@gmail.com>2017-07-18 17:06:09 -0700
commita5d557b96d873873e5f17d96ffca6088e3743af0 (patch)
treebe219ee2e65c801a5f2a5ff7980c4242b80fc974 /src
parent30939f88548a7318cac2642d6149f651c09f931a (diff)
Rename function to avoud future clash
Diffstat (limited to 'src')
-rw-r--r--src/cpp/client/secure_credentials.cc2
-rw-r--r--src/cpp/server/create_default_thread_pool.cc12
-rw-r--r--src/cpp/server/secure_server_credentials.h2
-rw-r--r--src/cpp/server/thread_pool_interface.h2
4 files changed, 7 insertions, 11 deletions
diff --git a/src/cpp/client/secure_credentials.cc b/src/cpp/client/secure_credentials.cc
index 0eefd0645b..057a058a3f 100644
--- a/src/cpp/client/secure_credentials.cc
+++ b/src/cpp/client/secure_credentials.cc
@@ -207,7 +207,7 @@ void MetadataCredentialsPluginWrapper::InvokePlugin(
MetadataCredentialsPluginWrapper::MetadataCredentialsPluginWrapper(
std::unique_ptr<MetadataCredentialsPlugin> plugin)
- : thread_pool_(CreateThreadPool()), plugin_(std::move(plugin)) {}
+ : thread_pool_(CreateDefaultThreadPool()), plugin_(std::move(plugin)) {}
std::shared_ptr<CallCredentials> MetadataCredentialsFromPlugin(
std::unique_ptr<MetadataCredentialsPlugin> plugin) {
diff --git a/src/cpp/server/create_default_thread_pool.cc b/src/cpp/server/create_default_thread_pool.cc
index bf76303b45..57faa17f6b 100644
--- a/src/cpp/server/create_default_thread_pool.cc
+++ b/src/cpp/server/create_default_thread_pool.cc
@@ -24,21 +24,17 @@
namespace grpc {
-static ThreadPoolInterface* CreateDefaultThreadPool() {
+static ThreadPoolInterface* CreateDefaultThreadPoolImpl() {
int cores = gpr_cpu_num_cores();
if (!cores) cores = 4;
return new DynamicThreadPool(cores);
}
-static CreateThreadPoolFunc g_ctp_impl = CreateDefaultThreadPool;
+static CreateThreadPoolFunc g_ctp_impl = CreateDefaultThreadPoolImpl;
-ThreadPoolInterface* CreateThreadPool() {
- return g_ctp_impl();
-}
+ThreadPoolInterface* CreateDefaultThreadPool() { return g_ctp_impl(); }
-void SetCreateThreadPool(CreateThreadPoolFunc func) {
- g_ctp_impl = func;
-}
+void SetCreateThreadPool(CreateThreadPoolFunc func) { g_ctp_impl = func; }
} // namespace grpc
diff --git a/src/cpp/server/secure_server_credentials.h b/src/cpp/server/secure_server_credentials.h
index 30ee1c7a36..212f0d1df3 100644
--- a/src/cpp/server/secure_server_credentials.h
+++ b/src/cpp/server/secure_server_credentials.h
@@ -39,7 +39,7 @@ class AuthMetadataProcessorAyncWrapper final {
AuthMetadataProcessorAyncWrapper(
const std::shared_ptr<AuthMetadataProcessor>& processor)
- : thread_pool_(CreateThreadPool()), processor_(processor) {}
+ : thread_pool_(CreateDefaultThreadPool()), processor_(processor) {}
private:
void InvokeProcessor(grpc_auth_context* context, const grpc_metadata* md,
diff --git a/src/cpp/server/thread_pool_interface.h b/src/cpp/server/thread_pool_interface.h
index 5a18298296..028842a776 100644
--- a/src/cpp/server/thread_pool_interface.h
+++ b/src/cpp/server/thread_pool_interface.h
@@ -36,7 +36,7 @@ class ThreadPoolInterface {
typedef ThreadPoolInterface* (*CreateThreadPoolFunc)(void);
void SetCreateThreadPool(CreateThreadPoolFunc func);
-ThreadPoolInterface* CreateThreadPool();
+ThreadPoolInterface* CreateDefaultThreadPool();
} // namespace grpc