Documentation Home >> Headers >> <jss/experimental_barrier.hpp> Header >> std::experimental::flex_barrier >> std::experimental::flex_barrier::arrive_and_wait member function

Signals that the calling thread has arrived at the synchronization point and block until all the participating threads have arrived.

void arrive_and_wait();

Preconditions:

Either the calling thread is one of the first N threads to arrive at *this since construction, where N is the value of the num_threads parameter to the constructor, or the calling thread is already one of the set of participating threads for *this.

Effects:

Signal that the calling thread has arrived at the flex_barrier. If this is the last of the participating threads to arrive then the completion function (if any) is called on one of the participating threads, and then all threads blocked on *this are unblocked and the flex_barrier is reset, otherwise blocks until all the participating threads have arrived.

Throws:

Nothing.

Header

#include <experimental/barrier>

See Also