aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2016-05-19 11:28:41 -0700
committerGravatar Craig Tiller <ctiller@google.com>2016-05-19 11:28:41 -0700
commit3eee9b4ace38ca348fd45029e4544213e8760842 (patch)
treeb1635efe95e7720660b93d03145ec70fe925f27b /src
parentdb7c35635b9013f3844d6abbd30a81d0b481677f (diff)
Mark sync cq as non-listening when it is
Diffstat (limited to 'src')
-rw-r--r--src/cpp/server/server.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/cpp/server/server.cc b/src/cpp/server/server.cc
index f955a31494..854057efbc 100644
--- a/src/cpp/server/server.cc
+++ b/src/cpp/server/server.cc
@@ -295,7 +295,12 @@ Server::Server(ThreadPoolInterface* thread_pool, bool thread_pool_owned,
grpc_channel_args channel_args;
args->SetChannelArgs(&channel_args);
server_ = grpc_server_create(&channel_args, nullptr);
- grpc_server_register_completion_queue(server_, cq_.cq(), nullptr);
+ if (thread_pool_ == nullptr) {
+ grpc_server_register_non_listening_completion_queue(server_, cq_.cq(),
+ nullptr);
+ } else {
+ grpc_server_register_completion_queue(server_, cq_.cq(), nullptr);
+ }
}
Server::~Server() {