10 #ifndef EIGEN_CXX11_THREADPOOL_SIMPLE_THREAD_POOL_H 11 #define EIGEN_CXX11_THREADPOOL_SIMPLE_THREAD_POOL_H 20 template <
typename Environment>
26 for (
int i = 0;
i < num_threads;
i++) {
36 std::unique_lock<std::mutex>
l(
mu_);
58 void Schedule(std::function<
void()> fn) final {
60 std::unique_lock<std::mutex>
l(
mu_);
67 w->
task = std::move(t);
78 if (pt->
pool ==
this) {
87 std::unique_lock<std::mutex>
l(
mu_);
121 typedef typename Environment::Task
Task;
122 typedef typename Environment::EnvThread
Thread;
125 std::condition_variable
cv;
154 #endif // EIGEN_CXX11_THREADPOOL_SIMPLE_THREAD_POOL_H
std::condition_variable empty_
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void push_back(const T &t)
void WorkerLoop(int thread_id)
Namespace containing all symbols from the Eigen library.
Environment::EnvThread Thread
void Schedule(std::function< void()> fn) final
std::condition_variable cv
static const Point3 pt(1.0, 2.0, 3.0)
static const Line3 l(Rot3(), 1, 1)
SimpleThreadPoolTempl(int num_threads, Environment env=Environment())
SimpleThreadPoolTempl * pool
int NumThreads() const final
std::deque< Task > pending_
MaxSizeVector< Waiter * > waiters_
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE size_t size() const
SimpleThreadPoolTempl< StlThreadEnvironment > SimpleThreadPool
PerThread * GetPerThread() const
#define EIGEN_THREAD_LOCAL
int CurrentThreadId() const final
MaxSizeVector< Thread * > threads_