Cyclicbarrier implementation in Java, can it be used as a latch too Here is my implementation of CyclicBarrier