A barrier is a thread coordination mechanism
whose lifetime consists of a sequence of barrier phases,
where each phase allows at most an expected number of threads to block
until the expected number of threads arrive at the barrier.
Exactly once after the expected count reaches zero, a thread
executes the completion step during its call
to arrive, arrive_and_drop, or wait,
except that it is implementation-defined
whether the step executes if no thread calls wait.
When the completion step finishes,
the expected count is reset
to what was specified by the expected argument to the constructor,
possibly adjusted by calls to arrive_and_drop, and
the next phase starts.
Unblocks all threads that are blocked on the phase synchronization point.
The end of the completion step strongly happens before
the returns from all calls that were unblocked by the completion step.
For specializations that do not have
the default value of the CompletionFunction template parameter,
the behavior is undefined if any of the barrier object's member functions
other than wait are called while the completion step is in progress.
The default value of the CompletionFunction template parameter is
an unspecified type, such that,
in addition to satisfying the requirements of CompletionFunction,
it meets the Cpp17DefaultConstructible
requirements (Table 30) and
completion() has no effects.