Inheritance diagram for AbstractLock::ConditionObject:
Public Member Functions | |
this (AbstractLock parent) | |
Private Member Functions | |
Node | addConditionWaiter () |
void | doNotify (Node first) |
void | doNotifyAll (Node first) |
void | notify () |
void | notifyAll () |
void | wait () |
long | waitNanos (long nanosTimeout) |
bool | wait (long time, TimeUnit unit) |
bool | isOwnedBy (AbstractLock sync) |
bool | hasWaiters () |
int | getWaitQueueLength () |
Thread[] | getWaitingThreads () |
Private Attributes | |
Node | firstWaiter |
Node | lastWaiter |
AbstractLock | parent |
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 AbstractLock
.
This class is Serializable, but all fields are transient, so deserialized conditions have no waiters.
Definition at line 1448 of file LockImpl.d.
|
Creates a new Definition at line 1457 of file LockImpl.d. References parent. |
|
Add a new waiter to wait queue
Definition at line 1467 of file LockImpl.d. References firstWaiter, lastWaiter, AbstractLock::Node::nextWaiter, and Node. Referenced by wait(), and waitNanos(). |
|
Remove and transfer nodes until hit non-cancelled one or null. Split out from signal in part to encourage compilers to inline the case of no waiters.
Definition at line 1484 of file LockImpl.d. References firstWaiter, lastWaiter, AbstractLock::Node::nextWaiter, parent, and AbstractLock::transferForNotify(). Referenced by notify(). |
|
Remove and transfer all nodes.
Definition at line 1497 of file LockImpl.d. References firstWaiter, lastWaiter, AbstractLock::Node::nextWaiter, parent, and AbstractLock::transferForNotify(). Referenced by notifyAll(). |
|
Moves the longest-waiting thread, if one exists, from the wait queue for this condition to the wait queue for the owning lock. Reimplemented from Condition. Definition at line 1514 of file LockImpl.d. References doNotify(), firstWaiter, AbstractLock::isHeldExclusively(), and parent. |
|
Moves all threads from the wait queue for this condition to the wait queue for the owning lock. Reimplemented from Condition. Definition at line 1526 of file LockImpl.d. References doNotifyAll(), firstWaiter, AbstractLock::isHeldExclusively(), and parent. |
|
Causes the current thread to wait until it is notified.
The lock associated with this
In all cases, before this method can return the current thread must re-acquire the lock associated with this condition. When the thread returns it is guaranteed to hold this lock. Implementation Considerations
The current thread is assumed to hold the lock associated with this Reimplemented from Condition. Definition at line 1544 of file LockImpl.d. References AbstractLock::acquireQueued(), addConditionWaiter(), AbstractLock::fullyRelease(), AbstractLock::isOnSyncQueue(), parent, and version. |
|
Implements timed condition wait.
Reimplemented from Condition. Definition at line 1566 of file LockImpl.d. References AbstractLock::acquireQueued(), addConditionWaiter(), AbstractLock::fullyRelease(), AbstractLock::isOnSyncQueue(), parent, sleepNanos(), and AbstractLock::transferAfterCancelledWait(). |
|
Implements timed condition wait.
Reimplemented from Condition. Definition at line 1596 of file LockImpl.d. References AbstractLock::acquireQueued(), addConditionWaiter(), AbstractLock::fullyRelease(), AbstractLock::isOnSyncQueue(), parent, sleepNanos(), toNanos(), and AbstractLock::transferAfterCancelledWait(). |
|
Returns true if this condition was created by the given synchronization object
Definition at line 1623 of file LockImpl.d. References parent. Referenced by AbstractLock::owns(). |
|
Queries whether any threads are waiting on this condition. Implements AbstractLock.hasWaiters
Definition at line 1633 of file LockImpl.d. References firstWaiter, AbstractLock::isHeldExclusively(), AbstractLock::Node::nextWaiter, and parent. Referenced by AbstractLock::hasWaiters(). |
|
Returns an estimate of the number of threads waiting on this condition. Implements AbstractLock.getWaitQueueLength
Definition at line 1649 of file LockImpl.d. References firstWaiter, AbstractLock::isHeldExclusively(), AbstractLock::Node::nextWaiter, and parent. Referenced by AbstractLock::getWaitQueueLength(). |
|
Returns a collection containing those threads that may be waiting on this Condition. Implements AbstractLock.getWaitingThreads
Definition at line 1666 of file LockImpl.d. References firstWaiter, AbstractLock::isHeldExclusively(), AbstractLock::Node::nextWaiter, and parent. Referenced by AbstractLock::getWaitingThreads(). |
|
First node of condition queue. Definition at line 1450 of file LockImpl.d. Referenced by addConditionWaiter(), doNotify(), doNotifyAll(), getWaitingThreads(), getWaitQueueLength(), hasWaiters(), notify(), and notifyAll(). |
|
Last node of condition queue. Definition at line 1452 of file LockImpl.d. Referenced by addConditionWaiter(), doNotify(), and doNotifyAll(). |
|
Definition at line 1453 of file LockImpl.d. Referenced by doNotify(), doNotifyAll(), getWaitingThreads(), getWaitQueueLength(), hasWaiters(), isOwnedBy(), notify(), notifyAll(), this(), wait(), and waitNanos(). |