Properly synchronize thread creation failure case

pull/24221/head
Vijay Pai 4 years ago committed by GitHub
parent 0809fd8b17
commit da7f82fa9c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      src/cpp/thread_manager/thread_manager.cc

@ -184,6 +184,8 @@ void ThreadManager::MainWorkLoop() {
if (worker->created()) {
worker->Start();
} else {
// Get lock again to undo changes to poller/thread counters.
grpc_core::MutexLock failure_lock(&mu_);
num_pollers_--;
num_threads_--;
resource_exhausted = true;

Loading…
Cancel
Save