Return -1 from CurrentThreadId when called by thread outside the pool.

This commit is contained in:
Rasmus Munk Larsen
2016-06-23 16:40:07 -07:00
parent d39df320d2
commit a9c1e4d7b7
5 changed files with 14 additions and 11 deletions

View File

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