aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Sree Kuchibhotla <sreek@google.com>2018-07-27 17:23:02 -0700
committerGravatar Sree Kuchibhotla <sreek@google.com>2018-07-27 17:23:02 -0700
commit6eac5e41b1bc238bfb4acc456b2f6c906b09e87e (patch)
tree683494e8894f648c7fbc564621e0d7610be1e2fd
parentece265778b077efa1c03e1de36b4e14446dd634a (diff)
std::max is not available on some windows platforms
-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);