diff options
author | 2016-11-08 10:56:16 -0800 | |
---|---|---|
committer | 2016-11-08 10:56:16 -0800 | |
commit | bd363544fd5d4d722c068b0ffc0991d7ea6a9277 (patch) | |
tree | 176fea48dc15ac859b2191fa1d57d4ce33e4a3a0 /src/cpp/thread_manager/thread_manager.h | |
parent | cc8b841832bba537aaf1c3a6e6dffb91894fe138 (diff) | |
parent | 24ef07c8afc8d59d9cfe67008bcd2d040467ff20 (diff) |
Merge remote-tracking branch 'upstream/master' into cares_buildin
Diffstat (limited to 'src/cpp/thread_manager/thread_manager.h')
-rw-r--r-- | src/cpp/thread_manager/thread_manager.h | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/cpp/thread_manager/thread_manager.h b/src/cpp/thread_manager/thread_manager.h index 9cfdb8af25..9c0569c62c 100644 --- a/src/cpp/thread_manager/thread_manager.h +++ b/src/cpp/thread_manager/thread_manager.h @@ -34,11 +34,12 @@ #ifndef GRPC_INTERNAL_CPP_THREAD_MANAGER_H #define GRPC_INTERNAL_CPP_THREAD_MANAGER_H +#include <condition_variable> #include <list> #include <memory> +#include <mutex> +#include <thread> -#include <grpc++/impl/sync.h> -#include <grpc++/impl/thd.h> #include <grpc++/support/config.h> namespace grpc { @@ -115,7 +116,7 @@ class ThreadManager { void Run(); ThreadManager* thd_mgr_; - grpc::thread thd_; + std::thread thd_; }; // The main funtion in ThreadManager @@ -134,10 +135,10 @@ class ThreadManager { // Protects shutdown_, num_pollers_ and num_threads_ // TODO: sreek - Change num_pollers and num_threads_ to atomics - grpc::mutex mu_; + std::mutex mu_; bool shutdown_; - grpc::condition_variable shutdown_cv_; + std::condition_variable shutdown_cv_; // Number of threads doing polling int num_pollers_; @@ -150,7 +151,7 @@ class ThreadManager { // currently polling i.e num_pollers_) int num_threads_; - grpc::mutex list_mu_; + std::mutex list_mu_; std::list<WorkerThread*> completed_threads_; }; |