11 #ifndef PARALLEL_CELLULAR_AUTOMATA_BARRIER_HPP 
   12 #define PARALLEL_CELLULAR_AUTOMATA_BARRIER_HPP 
   13 #include <condition_variable> 
   30     std::condition_variable cond;
 
   31     const unsigned n_threads;
 
   35     enum Direction : 
unsigned char 
   62     void wait(std::function<
void()> fun);
 
   76     void busy_wait(std::function<
void()> fun);
 
Self-resetting synchronization barrier for threads.
Definition: barrier.hpp:27
Barrier(unsigned n)
Construct a new Barrier object to syncronize n threads.
Definition: barrier.cpp:15
void wait()
wait for the other threads to reach the barrier.
Definition: barrier.cpp:23
void busy_wait()
busy wait for other threads to reach the barrier.
Definition: barrier.cpp:101
Namespace of the framework.
Definition: barrier.hpp:20