A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://en.cppreference.com/w/cpp/language/../algorithm/../../cpp/header/../experimental/latch.html below:

std::experimental::latch - cppreference.com

Merged into ISO C++ The functionality described on this page was merged into the mainline ISO C++ standard as of 7/2019; see std::latch (since C++20)

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.

Unlike std::experimental::barrier, std::experimental::latch can be decremented by a participating thread more than once.

[edit] Member functions constructs a latch
(public member function) [edit] destroys the latch
(public member function) [edit] not copy-assignable
(public member function) [edit] decrements the counter by 1 and blocks until it reaches zero
(public member function) [edit] decrements the counter in a non-blocking manner
(public member function) [edit] tests if the internal counter equals zero
(public member function) [edit] blocks until the counter reaches zero
(public member function) [edit]

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4