Implements arrival of a thread to the barrier and blocking wait for opening of the barrier.
The following two sets of operations upon a barrier bar are equivalent:
bar
and