diff options
Diffstat (limited to 'src/cpp/server')
-rw-r--r-- | src/cpp/server/fixed_size_thread_pool.cc | 3 | ||||
-rw-r--r-- | src/cpp/server/server.cc | 2 | ||||
-rw-r--r-- | src/cpp/server/server_context.cc | 2 |
3 files changed, 3 insertions, 4 deletions
diff --git a/src/cpp/server/fixed_size_thread_pool.cc b/src/cpp/server/fixed_size_thread_pool.cc index 710bcbb573..bafbc5802a 100644 --- a/src/cpp/server/fixed_size_thread_pool.cc +++ b/src/cpp/server/fixed_size_thread_pool.cc @@ -76,8 +76,7 @@ FixedSizeThreadPool::~FixedSizeThreadPool() { } } -void FixedSizeThreadPool::ScheduleCallback( - const std::function<void()>& callback) { +void FixedSizeThreadPool::Add(const std::function<void()>& callback) { grpc::lock_guard<grpc::mutex> lock(mu_); callbacks_.push(callback); cv_.notify_one(); diff --git a/src/cpp/server/server.cc b/src/cpp/server/server.cc index e6761d6244..ab87b22f5f 100644 --- a/src/cpp/server/server.cc +++ b/src/cpp/server/server.cc @@ -383,7 +383,7 @@ void Server::ScheduleCallback() { grpc::unique_lock<grpc::mutex> lock(mu_); num_running_cb_++; } - thread_pool_->ScheduleCallback(std::bind(&Server::RunRpc, this)); + thread_pool_->Add(std::bind(&Server::RunRpc, this)); } void Server::RunRpc() { diff --git a/src/cpp/server/server_context.cc b/src/cpp/server/server_context.cc index e028b9dc02..bf7a4ba5ec 100644 --- a/src/cpp/server/server_context.cc +++ b/src/cpp/server/server_context.cc @@ -145,7 +145,7 @@ void ServerContext::AddTrailingMetadata(const grpc::string& key, trailing_metadata_.insert(std::make_pair(key, value)); } -bool ServerContext::IsCancelled() { +bool ServerContext::IsCancelled() const { return completion_op_ && completion_op_->CheckCancelled(cq_); } |