Fixed Barrier test. First get the thread ID, then wait for the barrier to be reached.