Causes the thread to wait on the barrier.
#include <synch.h> int barrier_wait ( barrier_t *bp );
(IN) Points to the barrier.
If successful, returns zero; otherwise, returns -1 and sets errno to one of the following:
The barrier_wait function causes the calling thread to block until the required number of threads have also called the barrier_wait function. When the count reaches this limit, all threads are released to resume execution. The barrier is reset when the last waiting thread is released.
A barrier is not guaranteed to be a FIFO. You can make no assumptions about the order in which the threads are released.