Package dev.gmitch215.bytebox.locks
Interface Condition
public interface Condition
java.util.concurrent.locks.Condition, which the class library does not carry.- Since:
- 1.0.3
-
Method Summary
Modifier and TypeMethodDescriptionvoidawait()Releases the lock and suspends until signalled or interrupted, then takes the lock back.booleanlongawaitNanos(long nanosTimeout) voidReleases the lock and suspends until signalled, ignoring interruption.booleanawaitUntil(Date deadline) voidsignal()Wakes one waiter.voidWakes every waiter.
-
Method Details
-
await
Releases the lock and suspends until signalled or interrupted, then takes the lock back.- Throws:
InterruptedException- if the caller was interrupted
-
awaitUninterruptibly
void awaitUninterruptibly()Releases the lock and suspends until signalled, ignoring interruption. -
awaitNanos
- Parameters:
nanosTimeout- the longest to wait, in nanoseconds- Returns:
- an estimate of the nanoseconds left, zero or negative when the wait timed out
- Throws:
InterruptedException- if the caller was interrupted
-
await
- Parameters:
time- the longest to waitunit- the unit oftime- Returns:
- false when the wait timed out
- Throws:
InterruptedException- if the caller was interrupted
-
awaitUntil
- Parameters:
deadline- the moment to stop waiting at- Returns:
- false when the deadline passed
- Throws:
InterruptedException- if the caller was interrupted
-
signal
void signal()Wakes one waiter. -
signalAll
void signalAll()Wakes every waiter.
-