The CountDownLatch class has three basic elements:
- The initialization value that determines how many events the CountDownLatch object waits for
- The await() method, called by the threads that wait for the finalization of all the events
- The countDown() method, called by the events when they finish their execution
When you create a CountDownLatch object, it uses the constructor's parameter to initialize an internal counter. Every time a thread calls the countDown() method, the CountDownLatch object decrements the internal counter in one unit. When the internal counter reaches 0, the CountDownLatch object wakes up all the threads that were waiting in the await() method.
There's no way to re-initialize the internal counter of ...