diff options
author | David G. Quintas <dgq@google.com> | 2015-11-18 08:52:10 -0800 |
---|---|---|
committer | David G. Quintas <dgq@google.com> | 2015-11-18 08:52:10 -0800 |
commit | 75b53d6a5d891fa33a9173318b1446faeaf154e4 (patch) | |
tree | 7812e9e4c8afae8189756ba81e2d277986fffcf8 /src/cpp | |
parent | e32d514652056ea144daf1ed62002d2aa97f9fdb (diff) | |
parent | e24913b35b804287d4900de73358d6cd5666acec (diff) |
Merge pull request #3993 from ctiller/new_op
Core transport & call cleanup
Diffstat (limited to 'src/cpp')
-rw-r--r-- | src/cpp/common/alarm.cc | 8 | ||||
-rw-r--r-- | src/cpp/server/server.cc | 2 |
2 files changed, 4 insertions, 6 deletions
diff --git a/src/cpp/common/alarm.cc b/src/cpp/common/alarm.cc index bce0b174f8..1f0f04175e 100644 --- a/src/cpp/common/alarm.cc +++ b/src/cpp/common/alarm.cc @@ -38,12 +38,8 @@ namespace grpc { Alarm::Alarm(CompletionQueue* cq, gpr_timespec deadline, void* tag) : alarm_(grpc_alarm_create(cq->cq(), deadline, tag)) {} -Alarm::~Alarm() { - grpc_alarm_destroy(alarm_); -} +Alarm::~Alarm() { grpc_alarm_destroy(alarm_); } -void Alarm::Cancel() { - grpc_alarm_cancel(alarm_); -} +void Alarm::Cancel() { grpc_alarm_cancel(alarm_); } } // namespace grpc diff --git a/src/cpp/server/server.cc b/src/cpp/server/server.cc index f5063a079e..695e811654 100644 --- a/src/cpp/server/server.cc +++ b/src/cpp/server/server.cc @@ -388,6 +388,7 @@ void Server::ShutdownInternal(gpr_timespec deadline) { shutdown_ = true; grpc_server_shutdown_and_notify(server_, cq_.cq(), new ShutdownRequest()); cq_.Shutdown(); + lock.unlock(); // Spin, eating requests until the completion queue is completely shutdown. // If the deadline expires then cancel anything that's pending and keep // spinning forever until the work is actually drained. @@ -403,6 +404,7 @@ void Server::ShutdownInternal(gpr_timespec deadline) { SyncRequest::CallData call_data(this, request); } } + lock.lock(); // Wait for running callbacks to finish. while (num_running_cb_ != 0) { |