diff options
author | Sree Kuchibhotla <sreek@google.com> | 2018-07-27 17:23:02 -0700 |
---|---|---|
committer | Sree Kuchibhotla <sreek@google.com> | 2018-07-27 17:23:02 -0700 |
commit | 6eac5e41b1bc238bfb4acc456b2f6c906b09e87e (patch) | |
tree | 683494e8894f648c7fbc564621e0d7610be1e2fd | |
parent | ece265778b077efa1c03e1de36b4e14446dd634a (diff) |
std::max is not available on some windows platforms
-rw-r--r-- | src/cpp/thread_manager/thread_manager.cc | 5 |
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); |