#ifndef PLS_BARRIER_H #define PLS_BARRIER_H #include /** * Provides standard barrier behaviour. * `count` threads have to call `wait()` before any of the `wait()` calls returns, * thus blocking all threads until everyone reached the barrier. * * PORTABILITY: * Current implementation is based on pthreads. */ class barrier { pthread_barrier_t barrier_; public: explicit barrier(unsigned int count); ~barrier(); void wait(); }; #endif //PLS_BARRIER_H