pthread_barrier_wait implementation for Linux/SH.