std::latch:...ive_and_wait(3)
π NAME π
okay so bestie, welcome to the std::latch::arrive_and_wait page from the C++ Standard Libary manual (yes, that spelling is literally in the header β iykyk π
). This is the function std::latch::arrive_and_wait, and the NAME section is just that iconique name twice with a dash between. periodt.
std::latch::arrive_and_wait - std::latch::arrive_and_wait
β¨ Synopsis β¨
void arrive_and_wait( std::ptrdiff_t n = 1 ); (since C++20)
Okay so hereβs the tea β: it atomically decrements the internal counter by n and, if necessary, blocks the calling thread until the counter reaches zero. Equivalent to:
count_down(n); wait();
If n is greater than the value of the internal counter or is negative, the behavior is undefined π β like, do not do that, bestie, fr fr.
π Parameters π
nβ the value by which the internal counter is decreased
πΈ Return value πΈ
(none) β literally nothing, she gives void energy π
π¦ Exceptions π¦
Throws std::system_error with an error code allowed for mutex types on error.
cute sign-off: source/version ishttp://cppreference.com, dated2024.06.10. mwah πβ¨
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms