Don't call EnvThread::OnCancel by default since it doesn't do anything.

This commit is contained in:
Benoit Steiner 2016-12-14 18:33:39 -08:00
parent 9ff5d0f821
commit 3beb180ee5
2 changed files with 4 additions and 0 deletions

View File

@ -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);

View File

@ -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 {