13#ifndef EIGEN_CXX11_THREADPOOL_BARRIER_H
14#define EIGEN_CXX11_THREADPOOL_BARRIER_H
17#include "./InternalHeaderCheck.h"
23 Barrier(
unsigned int count) : state_(count << 1), notified_(false) {
24 eigen_plain_assert(((count << 1) >> 1) == count);
26 ~Barrier() { eigen_plain_assert((state_ >> 1) == 0); }
29 unsigned int v = state_.fetch_sub(2, std::memory_order_acq_rel) - 2;
34 eigen_plain_assert(((v + 2) & ~1) != 0);
37 EIGEN_MUTEX_LOCK l(mu_);
38 eigen_plain_assert(!notified_);
44 unsigned int v = state_.fetch_or(1, std::memory_order_acq_rel);
45 if ((v >> 1) == 0)
return;
46 EIGEN_MUTEX_LOCK l(mu_);
55 std::atomic<unsigned int> state_;
64struct Notification : Barrier {
65 Notification() : Barrier(1){};
Namespace containing all symbols from the Eigen library.
Definition Core:137