mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Added support for thread cancellation on Linux
This commit is contained in:
@@ -97,6 +97,12 @@ class NonBlockingThreadPoolTempl : public Eigen::ThreadPoolInterface {
|
||||
env_.ExecuteTask(t); // Push failed, execute directly.
|
||||
}
|
||||
|
||||
void Cancel() {
|
||||
for (size_t i = 0; i < threads_.size(); i++) {
|
||||
threads_[i]->Cancel();
|
||||
}
|
||||
}
|
||||
|
||||
int NumThreads() const final {
|
||||
return static_cast<int>(threads_.size());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user