aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/cpp/server
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2017-04-19 14:40:20 -0700
committerGravatar Craig Tiller <ctiller@google.com>2017-04-19 14:40:20 -0700
commit06a30eef36a84a7874783a0c01949989eb899d40 (patch)
tree96d97579d675db93d14be7e7d0a07cc2b00db100 /src/cpp/server
parent0dd38b5cb950bd67d74113fc455f67c999635dca (diff)
parentfeaee850bf82251f3797749f9b2ef4580b1ba002 (diff)
Merge github.com:grpc/grpc into cpparena
Diffstat (limited to 'src/cpp/server')
-rw-r--r--src/cpp/server/server_cc.cc11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/cpp/server/server_cc.cc b/src/cpp/server/server_cc.cc
index 3c42afd2b1..b4d6961db8 100644
--- a/src/cpp/server/server_cc.cc
+++ b/src/cpp/server/server_cc.cc
@@ -328,14 +328,18 @@ class Server::SyncRequestThreadManager : public ThreadManager {
}
}
- void ShutdownAndDrainCompletionQueue() {
+ void Shutdown() override {
server_cq_->Shutdown();
+ ThreadManager::Shutdown();
+ }
+ void Wait() override {
+ ThreadManager::Wait();
// Drain any pending items from the queue
void* tag;
bool ok;
while (server_cq_->Next(&tag, &ok)) {
- // Nothing to be done here
+ // Do nothing
}
}
@@ -415,7 +419,7 @@ Server::~Server() {
} else if (!started_) {
// Shutdown the completion queues
for (auto it = sync_req_mgrs_.begin(); it != sync_req_mgrs_.end(); it++) {
- (*it)->ShutdownAndDrainCompletionQueue();
+ (*it)->Shutdown();
}
}
}
@@ -579,7 +583,6 @@ void Server::ShutdownInternal(gpr_timespec deadline) {
// Wait for threads in all ThreadManagers to terminate
for (auto it = sync_req_mgrs_.begin(); it != sync_req_mgrs_.end(); it++) {
(*it)->Wait();
- (*it)->ShutdownAndDrainCompletionQueue();
}
// Drain the shutdown queue (if the previous call to AsyncNext() timed out