aboutsummaryrefslogtreecommitdiffhomepage
path: root/unsupported/Eigen/CXX11/src/ThreadPool/SimpleThreadPool.h
diff options
context:
space:
mode:
authorGravatar Benoit Steiner <benoit.steiner.goog@gmail.com>2016-12-08 08:12:49 -0800
committerGravatar Benoit Steiner <benoit.steiner.goog@gmail.com>2016-12-08 08:12:49 -0800
commit7bfff85355215a4702d4d42b1f3bfbfc08977372 (patch)
tree8698dff508476a28aece2f17fd5793407b987a15 /unsupported/Eigen/CXX11/src/ThreadPool/SimpleThreadPool.h
parent6811e6cf492731b3e1504bfa42237f909c93d129 (diff)
Added support for thread cancellation on Linux
Diffstat (limited to 'unsupported/Eigen/CXX11/src/ThreadPool/SimpleThreadPool.h')
-rw-r--r--unsupported/Eigen/CXX11/src/ThreadPool/SimpleThreadPool.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/unsupported/Eigen/CXX11/src/ThreadPool/SimpleThreadPool.h b/unsupported/Eigen/CXX11/src/ThreadPool/SimpleThreadPool.h
index e75d0f467..ab4f85fbf 100644
--- a/unsupported/Eigen/CXX11/src/ThreadPool/SimpleThreadPool.h
+++ b/unsupported/Eigen/CXX11/src/ThreadPool/SimpleThreadPool.h
@@ -69,6 +69,12 @@ class SimpleThreadPoolTempl : public ThreadPoolInterface {
}
}
+ void Cancel() {
+ for (size_t i = 0; i < threads_.size(); i++) {
+ threads_[i]->Cancel();
+ }
+ }
+
int NumThreads() const final {
return static_cast<int>(threads_.size());
}