diff options
author | Benoit Steiner <benoit.steiner.goog@gmail.com> | 2016-12-14 18:33:39 -0800 |
---|---|---|
committer | Benoit Steiner <benoit.steiner.goog@gmail.com> | 2016-12-14 18:33:39 -0800 |
commit | 3beb180ee5ef1d3387999ad270a2e2677ad0e814 (patch) | |
tree | ac087ce473d868248bf38a415b4ecbe683527239 /unsupported/Eigen/CXX11/src | |
parent | 9ff5d0f8214fb705aa315f686530c8b9f835d1f8 (diff) |
Don't call EnvThread::OnCancel by default since it doesn't do anything.
Diffstat (limited to 'unsupported/Eigen/CXX11/src')
-rw-r--r-- | unsupported/Eigen/CXX11/src/ThreadPool/NonBlockingThreadPool.h | 2 | ||||
-rw-r--r-- | unsupported/Eigen/CXX11/src/ThreadPool/SimpleThreadPool.h | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/unsupported/Eigen/CXX11/src/ThreadPool/NonBlockingThreadPool.h b/unsupported/Eigen/CXX11/src/ThreadPool/NonBlockingThreadPool.h index 0e6a0bf8f..ed1a761b6 100644 --- a/unsupported/Eigen/CXX11/src/ThreadPool/NonBlockingThreadPool.h +++ b/unsupported/Eigen/CXX11/src/ThreadPool/NonBlockingThreadPool.h @@ -114,9 +114,11 @@ class NonBlockingThreadPoolTempl : public Eigen::ThreadPoolInterface { done_ = true; // Let each thread know it's been cancelled. +#ifdef EIGEN_THREAD_ENV_SUPPORTS_CANCELLATION for (size_t i = 0; i < threads_.size(); i++) { threads_[i]->OnCancel(); } +#endif // Wake up the threads without work to let them exit on their own. ec_.Notify(true); diff --git a/unsupported/Eigen/CXX11/src/ThreadPool/SimpleThreadPool.h b/unsupported/Eigen/CXX11/src/ThreadPool/SimpleThreadPool.h index fb08deb20..335728665 100644 --- a/unsupported/Eigen/CXX11/src/ThreadPool/SimpleThreadPool.h +++ b/unsupported/Eigen/CXX11/src/ThreadPool/SimpleThreadPool.h @@ -70,9 +70,11 @@ class SimpleThreadPoolTempl : public ThreadPoolInterface { } void Cancel() { +#ifdef EIGEN_THREAD_ENV_SUPPORTS_CANCELLATION for (size_t i = 0; i < threads_.size(); i++) { threads_[i]->OnCancel(); } +#endif } int NumThreads() const final { |