aboutsummaryrefslogtreecommitdiffhomepage
path: root/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h
diff options
context:
space:
mode:
authorGravatar Benoit Steiner <benoit.steiner.goog@gmail.com>2016-03-22 15:24:49 -0700
committerGravatar Benoit Steiner <benoit.steiner.goog@gmail.com>2016-03-22 15:24:49 -0700
commitde7d92c259491ea2636fdbcbcb189399889be969 (patch)
treefe0f7e24d741a5bb20fff2255048c08af7664bf9 /unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h
parent002cf0d1c979857e057879d8c84b92439dbcc90d (diff)
parentbc2b8027514b27b3c67800d5c951e5d532f76f02 (diff)
Pulled latest updates from trunk
Diffstat (limited to 'unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h')
-rw-r--r--unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h
index e4165bbf8..4b8eda6bb 100644
--- a/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h
+++ b/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h
@@ -27,7 +27,7 @@ class ThreadPoolInterface {
class ThreadPool : public ThreadPoolInterface {
public:
// Construct a pool that contains "num_threads" threads.
- explicit ThreadPool(int num_threads) {
+ explicit ThreadPool(int num_threads) : threads_(num_threads, NULL), waiting_(num_threads, NULL) {
for (int i = 0; i < num_threads; i++) {
threads_.push_back(new std::thread([this]() { WorkerLoop(); }));
}
@@ -110,8 +110,8 @@ class ThreadPool : public ThreadPoolInterface {
};
std::mutex mu_;
- std::vector<std::thread*> threads_; // All threads
- std::vector<Waiter*> waiters_; // Stack of waiting threads.
+ MaxSizeVector<std::thread*> threads_; // All threads
+ MaxSizeVector<Waiter*> waiters_; // Stack of waiting threads.
std::deque<std::function<void()>> pending_; // Queue of pending work
std::condition_variable empty_; // Signaled on pending_.empty()
bool exiting_ = false;