Documentation Home >> Headers >> <jss/experimental_latch.hpp> Header >> std::experimental::latch >> std::experimental::latch::count_down member function

Decrease the internal count of the std::experimental::latch object by n.

void count_down(ptrdiff_t n);

Requires:

n>=0 and n<=count, where count is the internal counter value of the latch.

Effects:

Reduces the internal counter value of *this by n. If the counter is reduced to zero, the latch becomes ready and all waiting threads block in std::experimental::latch::wait or std::experimental::latch::count_down_and_wait are unblocked.

Postconditions:

If the counter is reduced to zero, is_ready()==true.

Header

#include <experimental/latch>

See Also