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

@@ -22,7 +22,7 @@ class ThreadPoolInterface {
virtual int NumThreads() const = 0;
// Returns a logical thread index between 0 and NumThreads() - 1 if called
// from one of the threads in the pool. Returns NumThreads() otherwise.
// from one of the threads in the pool. Returns -1 otherwise.
virtual int CurrentThreadId() const = 0;
virtual ~ThreadPoolInterface() {}