Pass the barrier to the thread