Add support for thread local support on platforms that do not support it through emulation using a hash map.

This commit is contained in:
Rasmus Munk Larsen
2018-08-13 15:31:23 -07:00
parent 3ec60215df
commit 8278ae6313
5 changed files with 103 additions and 76 deletions

View File

@@ -44,6 +44,14 @@
#include <thread>
#include <functional>
#include <memory>
#ifndef EIGEN_THREAD_LOCAL
// There are non-parenthesized calls to "max" in the <unordered_map> header,
// which trigger a check in test/main.h causing compilation to fail.
// We work around the check here by removing the check for max in
// the case where we have to emulate thread_local.
#undef max
#include <unordered_map>
#endif
#include "src/util/CXX11Meta.h"
#include "src/util/MaxSizeVector.h"
@@ -55,6 +63,7 @@
#include "src/ThreadPool/RunQueue.h"
#include "src/ThreadPool/ThreadPoolInterface.h"
#include "src/ThreadPool/ThreadEnvironment.h"
#include "src/ThreadPool/Barrier.h"
#include "src/ThreadPool/NonBlockingThreadPool.h"
#endif
@@ -62,4 +71,3 @@
#include <Eigen/src/Core/util/ReenableStupidWarnings.h>
#endif // EIGEN_CXX11_THREADPOOL_MODULE