std::barrier::arrive(3)

πŸ“¦ version 2024.07.05, in nixpkgs unstable, opensuse-leap 16.0

πŸ’… 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 if n is less than or equal to 0 or 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