Implements CyclicBarrier class