Javadoc
Simple counter latch that allows code to keep an up and down counter, and waits while the latch holds a certain wait value.
and threads using the latch to wait if the count has reached a certain value.
The counter latch can be used to keep track of an atomic counter, since the operations
#countDown()and
#countUp() are atomic.
When the latch reaches the wait value, threads will block. The counter latch can hence act like a
count down latch or a count up latch, while letting you keep track of the counter as well.
This counter latch works opposite as the java.util.concurrent.CountDownLatch, since the CounterLatch only blocks on a single value and releases the threads on all other values.