Class AwaitableCounter
java.lang.Object
org.jdrupes.builder.core.AwaitableCounter
A counter that supports waiting for a specific value. The waiting
thread is woken when the counter hits the target value.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassIncrement/decrement with an AutoCloseable. -
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
AwaitableCounter
public AwaitableCounter()Initializes a new awaitable counter.
-
-
Method Details
-
increment
-
decrement
-
value
-
acquire
-
await
Wait for the counter to reach the given value.- Parameters:
wanted- the wanted- Returns:
- the counter
- Throws:
InterruptedException- the interrupted exception
-