mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Return -1 from CurrentThreadId when called by thread outside the pool.
This commit is contained in:
@@ -172,6 +172,8 @@ struct ThreadPoolDevice {
|
||||
pool_->Schedule(func);
|
||||
}
|
||||
|
||||
// Returns a logical thread index between 0 and pool_->NumThreads() - 1 if
|
||||
// called from one of the threads in pool_. Returns -1 otherwise.
|
||||
EIGEN_STRONG_INLINE int currentThreadId() const {
|
||||
return pool_->CurrentThreadId();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user