jsat.utils
Class ModifiableCountDownLatch
- java.lang.Object
-
- jsat.utils.ModifiableCountDownLatch
-
public class ModifiableCountDownLatch extends java.lang.ObjectProvides aCountDownLatchthat can have the number of counts increased as well as decreased.
-
-
Constructor Summary
Constructors Constructor and Description ModifiableCountDownLatch(int count)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidawait()Waits until the count gets reduced to zero, and then all threads waiting will get to run.voidcountDown()Decrements the counter.voidcountUp()Increments the count.
-
-
-
Method Detail
-
await
public void await() throws java.lang.InterruptedExceptionWaits until the count gets reduced to zero, and then all threads waiting will get to run.- Throws:
java.lang.InterruptedException
-
countDown
public void countDown()
Decrements the counter. Allowing threads that have calledawait()to run once the count reaches zero.
-
countUp
public void countUp()
Increments the count. Once the count has reached zero once, incrementing the count back above zero will have no affect.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG