mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-12 19:59:05 +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;
|
done_ = true;
|
||||||
|
|
||||||
// Let each thread know it's been cancelled.
|
// Let each thread know it's been cancelled.
|
||||||
|
#ifdef EIGEN_THREAD_ENV_SUPPORTS_CANCELLATION
|
||||||
for (size_t i = 0; i < threads_.size(); i++) {
|
for (size_t i = 0; i < threads_.size(); i++) {
|
||||||
threads_[i]->OnCancel();
|
threads_[i]->OnCancel();
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// Wake up the threads without work to let them exit on their own.
|
// Wake up the threads without work to let them exit on their own.
|
||||||
ec_.Notify(true);
|
ec_.Notify(true);
|
||||||
|
@ -70,9 +70,11 @@ class SimpleThreadPoolTempl : public ThreadPoolInterface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Cancel() {
|
void Cancel() {
|
||||||
|
#ifdef EIGEN_THREAD_ENV_SUPPORTS_CANCELLATION
|
||||||
for (size_t i = 0; i < threads_.size(); i++) {
|
for (size_t i = 0; i < threads_.size(); i++) {
|
||||||
threads_[i]->OnCancel();
|
threads_[i]->OnCancel();
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
int NumThreads() const final {
|
int NumThreads() const final {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user