1

Is there any way to use a unique CountDownLatch multiple times?

I mean after creating an instance of CountDownLatch and set it's count value, after it reaches 0 by invoking countDown() method on that instance, we set a new count value and again start to count down on that instance or when a CountDownLatch reaches 0, it will set it's count value automatically to the value that we determine in it's constructor.

1 Answers1

4

No.

Use CyclicBarrier instead, which supports reset.

xingbin
  • 27,410
  • 9
  • 53
  • 103