Documentation Home >> Headers >> <jss/experimental_latch.hpp> Header >> std::experimental::latch class

The latch class is a single use count-down latch that triggers when count events have occurred. Any number of threads may wait for the latch to trigger, and there is no requirement that the threads providing the count-down events have any explicit relationship with the waiting threads.

class latch{
    explicit latch(ptrdiff_t count);

    void count_down_and_wait();
    void count_down(ptrdiff_t n);
    bool is_ready() const noexcept;
    void wait() const;

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

#include <experimental/latch>

See Also