cpp/thread/barrier/wait

If is associated with the phase synchronization point for the current phase of, blocks at the synchronization point associated with  until the phase completion step of the synchronization point's phase is run.

Otherwise, if is associated with the phase synchronization point for the immediately preceding phase of, returns immediately.

Otherwise, i.e. if is associated with the phase synchronization point for an earlier phase of  or any phase of a barrier object other than, the behavior is undefined.

Return value
(none)

Exceptions
Throws std with an error code allowed for mutex types on error.