mohamadreza
mohamadreza

Reputation: 93

use a CountDownLatch multiple times

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.

Upvotes: 1

Views: 1163

Answers (1)

xingbin
xingbin

Reputation: 28279

No.

Use CyclicBarrier instead, which supports reset.

Upvotes: 4

Related Questions