Implemented a more portable version of thread local variables

This commit is contained in:
Benoit Steiner
2016-04-19 15:56:02 -07:00
parent 04f954956d
commit 2b72163028
3 changed files with 24 additions and 1 deletions

View File

@@ -212,7 +212,7 @@ class NonBlockingThreadPoolTempl : public Eigen::ThreadPoolInterface {
}
PerThread* GetPerThread() {
static thread_local PerThread per_thread_;
EIGEN_THREAD_LOCAL PerThread per_thread_;
PerThread* pt = &per_thread_;
if (pt->inited) return pt;
pt->inited = true;