Class CountDown
- java.lang.Object
-
- org.elasticsearch.common.util.concurrent.CountDown
-
public final class CountDown extends java.lang.Object
A simple thread safe count-down class that in contrast to aCountDownLatch
never blocks. This class is useful if a certain action has to wait for N concurrent tasks to return or a timeout to occur in order to proceed.
-
-
Constructor Summary
Constructors Constructor Description CountDown(int count)
-
Method Summary
Modifier and Type Method Description boolean
countDown()
Decrements the count-down and returnstrue
iff this call reached zero otherwisefalse
boolean
fastForward()
Fast forwards the count-down to zero and returnstrue
iff the count down reached zero with this fast forward call otherwisefalse
boolean
isCountedDown()
Returnstrue
iff the count-down has reached zero.
-
-
-
Method Detail
-
countDown
public boolean countDown()
Decrements the count-down and returnstrue
iff this call reached zero otherwisefalse
-
fastForward
public boolean fastForward()
Fast forwards the count-down to zero and returnstrue
iff the count down reached zero with this fast forward call otherwisefalse
-
isCountedDown
public boolean isCountedDown()
Returnstrue
iff the count-down has reached zero. Otherwisefalse
-
-