##### cppreference.com

##### Search

Create account

##### Namespaces

- Page
- Discussion

##### Variants

##### Views

- View
- Edit
- History

##### Actions

# std::experimental::latch

From cppreference.com
< cpp‎ | experimental

Defined in header `<experimental/latch>` |  |
class latch; |  | (concurrency TS)

The `latch` class is a downward counter of type `ptrdiff_t` which can be used to synchronize threads. The value of the counter is initialized on creation. Threads may block on the latch until the counter is decremented to zero. There is no possibility to increase or reset the counter, which makes the latch a single-use barrier.

### [edit] Member functions

(constructor) | constructs a `latch` (public member function) [edit]
(destructor) | destroys the latch (public member function) [edit]
operator= [deleted] | not copy-assignable (public member function) [edit]
count_down_and_wait | decrements the counter by `1` and blocks until it reaches zero (public member function) [edit]
count_down | decrements the counter in a non-blocking manner (public member function) [edit]
is_ready | tests if the internal counter equals zero (public member function) [edit]
wait | blocks until the counter reaches zero (public member function) [edit]

Retrieved from "http://en.cppreference.com/mwiki/index.php?title=cpp/experimental/latch&oldid=82273"