mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-03-07 18:27:40 +08:00
Don't call EnvThread::OnCancel by default since it doesn't do anything.
This commit is contained in:
parent
9ff5d0f821
commit
3beb180ee5
@ -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);
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user