std::barrier::arrive(3)
π
std::barrier::arrive π
okay so bestie, welcome to the std::barrier::arrive(3) page from the C++ Standard Libary manual β yes, thatβs the manual name, typo and all, and weβre folding it in right here at the top so you know exactly whatβs up. β¨
π NAME π
std::barrier::arrive β std::barrier::arrive π
β¨ Synopsis β¨
[[nodiscard]] arrival_token arrive( std::ptrdiff_t n = 1 ); (since C++20)
Okay so picture this: you call this, and it constructs an arrival_token object associated with the phase synchronization point for the current phase. Then it decrements the expected count by n. Thatβs the whole little routine, bestie. π¦
This function executes atomically. The call to this function strongly happens-before the start of the phase completion step for the current phase. No cap, thatβs the ordering guarantee. π₯
β οΈ Undefined behavior alert: the behavior is undefined ifnis less than or equal to0or greater than the expected count for the current barrier phase. This is the βdo not do thatβ zone, fr fr. π
π Parameters π
nβ the value by which the expected count is decreased. π
π¦ Return value π¦
The constructed arrival_token object. Sheβs built, sheβs returned, sheβs iconic. π
π₯ Exceptions π₯
Throws std::system_error with an error code allowed for mutex types on error. Yep, thatβs the error situation, periodt. π
πΈ Notes πΈ
This function can cause the completion step for the current phase to start. So like, your little arrive call can absolutely kick things off β the notes said it, not me. π
π§ Example π§
This section is incomplete.
Reason: no example.
bestie there is literally no example here. We are respecting the source material and also respecting the void. π
π See also π
waitβ blocks at the phase synchronization point until its phase completion step is run (public member function).
π Category π
* Todo no example
xoxo, your Unix bestie π β source/version and date: http://cppreference.com, 2024.06.10 edition. periodt. π
π¦ 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