java.lang.Object | |
↳ | java.util.concurrent.locks.AbstractQueuedSynchronizer.ConditionObject |
Condition implementation for a AbstractQueuedSynchronizer
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 AbstractQueuedSynchronizer.
This class is Serializable, but all fields are transient, so deserialized conditions have no waiters.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creates a new ConditionObject instance.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Implements timed condition wait.
| |||||||||||
Implements interruptible condition wait.
| |||||||||||
Implements timed condition wait.
| |||||||||||
Implements uninterruptible condition wait.
| |||||||||||
Implements absolute timed condition wait.
| |||||||||||
Moves the longest-waiting thread, if one exists, from the
wait queue for this condition to the wait queue for the
owning lock.
| |||||||||||
Moves all threads from the wait queue for this condition to
the wait queue for the owning lock.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Returns an estimate of the number of threads waiting on
this condition.
| |||||||||||
Returns a collection containing those threads that may be
waiting on this Condition.
| |||||||||||
Queries whether any threads are waiting on this condition.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class java.lang.Object
| |||||||||||
From interface java.util.concurrent.locks.Condition
|
Creates a new ConditionObject instance.
Implements timed condition wait.
getState()
.
release(int)
with
saved state as argument, throwing
IllegalMonitorStateException if it fails.
acquire(int)
with saved state as argument.
time | the maximum time to wait |
---|---|
unit | the time unit of the time argument. |
InterruptedException | if the current thread is interrupted (and interruption of thread suspension is supported). |
---|
Implements interruptible condition wait.
getState()
.
release(int)
with
saved state as argument, throwing
IllegalMonitorStateException if it fails.
acquire(int)
with saved state as argument.
InterruptedException | if the current thread is interrupted (and interruption of thread suspension is supported). |
---|
Implements timed condition wait.
getState()
.
release(int)
with
saved state as argument, throwing
IllegalMonitorStateException if it fails.
acquire(int)
with saved state as argument.
nanosTimeout | the maximum time to wait, in nanoseconds |
---|
InterruptedException | if the current thread is interrupted (and interruption of thread suspension is supported). |
---|
Implements uninterruptible condition wait.
getState()
.
release(int)
with
saved state as argument, throwing
IllegalMonitorStateException if it fails.
acquire(int)
with saved state as argument.
Implements absolute timed condition wait.
getState()
.
release(int)
with
saved state as argument, throwing
IllegalMonitorStateException if it fails.
acquire(int)
with saved state as argument.
deadline | the absolute time to wait until |
---|
InterruptedException | if the current thread is interrupted (and interruption of thread suspension is supported). |
---|
Moves the longest-waiting thread, if one exists, from the wait queue for this condition to the wait queue for the owning lock.
IllegalMonitorStateException | if isHeldExclusively()
returns false
|
---|
Moves all threads from the wait queue for this condition to the wait queue for the owning lock.
IllegalMonitorStateException | if isHeldExclusively()
returns false
|
---|
Returns an estimate of the number of threads waiting on
this condition.
Implements getWaitQueueLength(AbstractQueuedSynchronizer.ConditionObject)
.
IllegalMonitorStateException | if isHeldExclusively()
returns false
|
---|
Returns a collection containing those threads that may be
waiting on this Condition.
Implements getWaitingThreads(AbstractQueuedSynchronizer.ConditionObject)
.
IllegalMonitorStateException | if isHeldExclusively()
returns false
|
---|
Queries whether any threads are waiting on this condition.
Implements hasWaiters(AbstractQueuedSynchronizer.ConditionObject)
.
true
if there are any waiting threadsIllegalMonitorStateException | if isHeldExclusively()
returns false
|
---|