fixed pthread_barrier_wait bug