summaryrefslogtreecommitdiff
path: root/grpc/src/cpp/thread_manager/thread_manager.cc
diff options
context:
space:
mode:
Diffstat (limited to 'grpc/src/cpp/thread_manager/thread_manager.cc')
-rw-r--r--grpc/src/cpp/thread_manager/thread_manager.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/grpc/src/cpp/thread_manager/thread_manager.cc b/grpc/src/cpp/thread_manager/thread_manager.cc
index c8560aa8..5155f610 100644
--- a/grpc/src/cpp/thread_manager/thread_manager.cc
+++ b/grpc/src/cpp/thread_manager/thread_manager.cc
@@ -152,7 +152,7 @@ void ThreadManager::MainWorkLoop() {
bool ok;
WorkStatus work_status = PollForWork(&tag, &ok);
- grpc_core::ReleasableMutexLock lock(&mu_);
+ grpc_core::LockableAndReleasableMutexLock lock(&mu_);
// Reduce the number of pollers by 1 and check what happened with the poll
num_pollers_--;
bool done = false;
@@ -179,7 +179,7 @@ void ThreadManager::MainWorkLoop() {
max_active_threads_sofar_ = num_threads_;
}
// Drop lock before spawning thread to avoid contention
- lock.Unlock();
+ lock.Release();
WorkerThread* worker = new WorkerThread(this);
if (worker->created()) {
worker->Start();
@@ -195,17 +195,17 @@ void ThreadManager::MainWorkLoop() {
// There is still at least some thread polling, so we can go on
// even though we are below the number of pollers that we would
// like to have (min_pollers_)
- lock.Unlock();
+ lock.Release();
} else {
// There are no pollers to spare and we couldn't allocate
// a new thread, so resources are exhausted!
- lock.Unlock();
+ lock.Release();
resource_exhausted = true;
}
} else {
// There are a sufficient number of pollers available so we can do
// the work and continue polling with our existing poller threads
- lock.Unlock();
+ lock.Release();
}
// Lock is always released at this point - do the application work
// or return resource exhausted if there is new work but we couldn't