Documentation Home >> Headers >> <jss/experimental_barrier.hpp> Header >> std::experimental::barrier class

The barrier class is a simple barrier for N threads. The number of participating threads is specified in the constructor. The first N threads to call either std::experimental::barrier::arrive_and_wait or std::experimental::barrier::arrive_and_drop form the set of participating threads.

class barrier{
    explicit barrier(ptrdiff_t num_threads);

    barrier(barrier const&)=delete;
    barrier& operator=(barrier const&)=delete;

    void arrive_and_drop();
    void arrive_and_wait();

#include <experimental/barrier>

See Also