diff options
author | 2016-12-08 08:12:49 -0800 | |
---|---|---|
committer | 2016-12-08 08:12:49 -0800 | |
commit | 7bfff85355215a4702d4d42b1f3bfbfc08977372 (patch) | |
tree | 8698dff508476a28aece2f17fd5793407b987a15 /unsupported/Eigen/CXX11/src/ThreadPool/SimpleThreadPool.h | |
parent | 6811e6cf492731b3e1504bfa42237f909c93d129 (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.h | 6 |
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()); } |