public class AbstractQueuedLongSynchronizer.ConditionObject
extends java.lang.Object
implements java.util.concurrent.locks.Condition, java.io.Serializable
AbstractQueuedLongSynchronizer serving as the basis of a Lock implementation.
Method documentation for this class describes mechanics,
not behavioral specifications from the point of view of Lock
and Condition users. Exported versions of this class will in
general need to be accompanied by documentation describing
condition semantics that rely on those of the associated
AbstractQueuedLongSynchronizer.
This class is Serializable, but all fields are transient, so deserialized conditions have no waiters.
| Constructor and Description |
|---|
ConditionObject()
Creates a new
ConditionObject instance. |
| Modifier and Type | Method and Description |
|---|---|
void |
await()
Implements interruptible condition wait.
|
boolean |
await(long time,
java.util.concurrent.TimeUnit unit)
Implements timed condition wait.
|
long |
awaitNanos(long nanosTimeout)
Implements timed condition wait.
|
void |
awaitUninterruptibly()
Implements uninterruptible condition wait.
|
boolean |
awaitUntil(java.util.Date deadline)
Implements absolute timed condition wait.
|
protected java.util.Collection<Strand> |
getWaitingStrands()
Returns a collection containing those strands that may be
waiting on this Condition.
|
protected int |
getWaitQueueLength()
Returns an estimate of the number of strands waiting on
this condition.
|
protected boolean |
hasWaiters()
Queries whether any strands are waiting on this condition.
|
void |
signal()
Moves the longest-waiting strand, if one exists, from the
wait queue for this condition to the wait queue for the
owning lock.
|
void |
signalAll()
Moves all strands from the wait queue for this condition to
the wait queue for the owning lock.
|
public final void signal()
signal in interface java.util.concurrent.locks.Conditionjava.lang.IllegalMonitorStateException - if AbstractQueuedLongSynchronizer.isHeldExclusively()
returns falsepublic final void signalAll()
signalAll in interface java.util.concurrent.locks.Conditionjava.lang.IllegalMonitorStateException - if AbstractQueuedLongSynchronizer.isHeldExclusively()
returns false@Suspendable public final void awaitUninterruptibly()
AbstractQueuedLongSynchronizer.getState().
AbstractQueuedLongSynchronizer.release(long) with saved state as argument,
throwing IllegalMonitorStateException if it fails.
AbstractQueuedLongSynchronizer.acquire(long) with saved state as argument.
awaitUninterruptibly in interface java.util.concurrent.locks.Conditionpublic final void await()
throws java.lang.InterruptedException
AbstractQueuedLongSynchronizer.getState().
AbstractQueuedLongSynchronizer.release(long) with saved state as argument,
throwing IllegalMonitorStateException if it fails.
AbstractQueuedLongSynchronizer.acquire(long) with saved state as argument.
await in interface java.util.concurrent.locks.Conditionjava.lang.InterruptedException@Suspendable public final long awaitNanos(long nanosTimeout) throws java.lang.InterruptedException
AbstractQueuedLongSynchronizer.getState().
AbstractQueuedLongSynchronizer.release(long) with saved state as argument,
throwing IllegalMonitorStateException if it fails.
AbstractQueuedLongSynchronizer.acquire(long) with saved state as argument.
awaitNanos in interface java.util.concurrent.locks.Conditionjava.lang.InterruptedException@Suspendable public final boolean awaitUntil(java.util.Date deadline) throws java.lang.InterruptedException
AbstractQueuedLongSynchronizer.getState().
AbstractQueuedLongSynchronizer.release(long) with saved state as argument,
throwing IllegalMonitorStateException if it fails.
AbstractQueuedLongSynchronizer.acquire(long) with saved state as argument.
awaitUntil in interface java.util.concurrent.locks.Conditionjava.lang.InterruptedException@Suspendable public final boolean await(long time, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException
AbstractQueuedLongSynchronizer.getState().
AbstractQueuedLongSynchronizer.release(long) with saved state as argument,
throwing IllegalMonitorStateException if it fails.
AbstractQueuedLongSynchronizer.acquire(long) with saved state as argument.
await in interface java.util.concurrent.locks.Conditionjava.lang.InterruptedExceptionprotected final boolean hasWaiters()
AbstractQueuedLongSynchronizer.hasWaiters(ConditionObject).true if there are any waiting strandsjava.lang.IllegalMonitorStateException - if AbstractQueuedLongSynchronizer.isHeldExclusively()
returns falseprotected final int getWaitQueueLength()
AbstractQueuedLongSynchronizer.getWaitQueueLength(ConditionObject).java.lang.IllegalMonitorStateException - if AbstractQueuedLongSynchronizer.isHeldExclusively()
returns falseprotected final java.util.Collection<Strand> getWaitingStrands()
AbstractQueuedLongSynchronizer.getWaitingStrands(ConditionObject).java.lang.IllegalMonitorStateException - if AbstractQueuedLongSynchronizer.isHeldExclusively()
returns false