From 7bfff85355215a4702d4d42b1f3bfbfc08977372 Mon Sep 17 00:00:00 2001 From: Benoit Steiner Date: Thu, 8 Dec 2016 08:12:49 -0800 Subject: Added support for thread cancellation on Linux --- unsupported/Eigen/CXX11/src/ThreadPool/SimpleThreadPool.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'unsupported/Eigen/CXX11/src/ThreadPool/SimpleThreadPool.h') 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(threads_.size()); } -- cgit v1.2.3