use pthread_barrier instead of sleep() in 'threads' test