diff options
author | Craig Tiller <craig.tiller@gmail.com> | 2015-06-02 16:55:54 -0700 |
---|---|---|
committer | Craig Tiller <craig.tiller@gmail.com> | 2015-06-02 16:55:54 -0700 |
commit | a4b89fed1c801cdb31a154c7e1c09e5650898e8a (patch) | |
tree | d0a00563db8df1da5d69dee362664a85112f20cb /src/cpp | |
parent | aaa03d74ceae4d48e31f4ba0619e359acd21505a (diff) | |
parent | c86b1dd59d1e61b9377f2dca0741061b2e5de1da (diff) |
Merge github.com:grpc/grpc into you-complete-me
Conflicts:
src/core/iomgr/resolve_address_posix.c
src/core/surface/server.c
Diffstat (limited to 'src/cpp')
-rw-r--r-- | src/cpp/server/thread_pool.cc | 5 | ||||
-rw-r--r-- | src/cpp/server/thread_pool.h | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/cpp/server/thread_pool.cc b/src/cpp/server/thread_pool.cc index e8d0e89ed2..118cabcb61 100644 --- a/src/cpp/server/thread_pool.cc +++ b/src/cpp/server/thread_pool.cc @@ -60,7 +60,7 @@ void ThreadPool::ThreadFunc() { ThreadPool::ThreadPool(int num_threads) : shutdown_(false) { for (int i = 0; i < num_threads; i++) { - threads_.push_back(grpc::thread(&ThreadPool::ThreadFunc, this)); + threads_.push_back(new grpc::thread(&ThreadPool::ThreadFunc, this)); } } @@ -71,7 +71,8 @@ ThreadPool::~ThreadPool() { cv_.notify_all(); } for (auto t = threads_.begin(); t != threads_.end(); t++) { - t->join(); + (*t)->join(); + delete *t; } } diff --git a/src/cpp/server/thread_pool.h b/src/cpp/server/thread_pool.h index 0f24d6e9b3..26f25611b5 100644 --- a/src/cpp/server/thread_pool.h +++ b/src/cpp/server/thread_pool.h @@ -57,7 +57,7 @@ class ThreadPool GRPC_FINAL : public ThreadPoolInterface { grpc::condition_variable cv_; bool shutdown_; std::queue<std::function<void()>> callbacks_; - std::vector<grpc::thread> threads_; + std::vector<grpc::thread*> threads_; void ThreadFunc(); }; |