std::barrie...ive_and_drop(3)
π NAME π
std::barrier::arrive_and_drop β truly std::barrier::arrive_and_drop, the whole name. The header on this page is std::barrie...ive_and_drop(3) because even manpages get truncation drama π, and it lives in the C++ Standard Libary (their spelling, not mine π
).
πΈ Synopsis πΈ
void arrive_and_drop();
(since C++20)
Okay so here's the lore: it decrements the initial expected count for all subsequent phases by one, and then it decrements the expected count for the current phase by one. Both. In that order. π
This function is executed atomically. The call to this function strongly happens-before the start of the phase completion step for the current phase.
β οΈ The behavior is undefined if the expected count for the current phase is zero. Like, do not do that. π
π Parameters π
- (none)
π¦ Return value π¦
- (none)
π Exceptions π
- Throws
std::system_errorwith an error code allowed for mutex types on error.
β¨ Notes β¨
- This function can cause the completion step for the current phase to start. Iconic, honestly.
- If the current expected count is zero before calling this function, the initial expected count for all subsequent phases is also zero, which means the barrier cannot be reused. That's a one-way trip, bestie. π
π§ Example π§
This section is incomplete.
Reason: no example.
π Category π
- Todo no example
This cutie came from http://cppreference.com and is dated 2024.06.10 β source and date, right there, no cap. π«Άβ¨π
π¦ 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