aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/cpp/thread_manager/thread_manager.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/cpp/thread_manager/thread_manager.cc b/src/cpp/thread_manager/thread_manager.cc
index 57067d4696..fa9eec5f9b 100644
--- a/src/cpp/thread_manager/thread_manager.cc
+++ b/src/cpp/thread_manager/thread_manager.cc
@@ -170,8 +170,9 @@ void ThreadManager::MainWorkLoop() {
grpc_resource_user_allocate_threads(resource_user_, 1)) {
num_pollers_++;
num_threads_++;
- max_active_threads_sofar_ =
- std::max(max_active_threads_sofar_, num_threads_);
+ if (num_threads_ > max_active_threads_sofar_) {
+ max_active_threads_sofar_ = num_threads_;
+ }
// Drop lock before spawning thread to avoid contention
lock.unlock();
new WorkerThread(this);