A CountDownLatch is initialized with a given count. The await methods block until the current count reaches zero due to invocations of the countDown() method, after which all waiting threads are released and any subsequent invocations of await return immediately. This is a one-shot phenomenon -- the count cannot be reset. If you need a version that resets the count, consider using a CyclicBarrier.
Javadoc here: http://docs.oracle.com/javase/1.5.0/docs/api/java/util/concurrent/CountDownLatch.html
No comments:
Post a Comment