Inheritance diagram for ReentrantLock::Sync:
Public Member Functions | |
void | lock () |
bool | nonfairTryAcquire (int acquires) |
bool | tryRelease (int releases) |
bool | isHeldExclusively () |
ConditionObject | newCondition () |
Thread | getOwner () |
int | getHoldCount () |
bool | isLocked () |
Public Attributes | |
Thread | owner |
Private Member Functions | |
this () | |
Node | v_head () |
void | v_head (Node val) |
Node | v_tail () |
void | v_tail (Node val) |
final int | state () |
final void | state (int newState) |
bool | tryAcquire (int arg) |
int | tryAcquireShared (int arg) |
bool | tryReleaseShared (int arg) |
void | acquire (int arg) |
bool | tryAcquireNanos (int arg, long nanosTimeout) |
bool | release (int arg) |
void | acquireShared (int arg) |
bool | tryAcquireSharedNanos (int arg, long nanosTimeout) |
bool | releaseShared (int arg) |
bool | hasQueuedThreads () |
bool | hasContended () |
Thread | getFirstQueuedThread () |
Private Attributes | |
int | state_ |
|
Reimplemented in ReentrantLock::NonfairSync, and ReentrantLock::FairSync. Referenced by ReentrantLock::lock(). |
|
Definition at line 114 of file ReentrantLock.d. References owner. Referenced by ReentrantLock::NonfairSync::tryAcquire(), and ReentrantLock::tryLock(). |
|
Attempts to set the state to reflect a release in exclusive mode. This method is always invoked by the thread performing release. The default implementation throws UnsupportedOperationException
Reimplemented from AbstractLock. Definition at line 130 of file ReentrantLock.d. References owner. |
|
Returns true if synchronization is held exclusively with respect to the current (calling) thread. This method is invoked upon each call to a non-waiting ConditionObject method. (Waiting methods instead invoke release.) The default implementation throws UnsupportedOperationException. This method is invoked internally only within ConditionObject methods, so need not be defined if conditions are not used.
Reimplemented from AbstractLock. Definition at line 143 of file ReentrantLock.d. References owner. Referenced by ReentrantLock::isHeldByCurrentThread(). |
|
Definition at line 147 of file ReentrantLock.d. Referenced by ReentrantLock::newCondition(). |
|
Definition at line 153 of file ReentrantLock.d. References owner. Referenced by ReentrantLock::getOwner(), and ReentrantLock::toString(). |
|
Definition at line 159 of file ReentrantLock.d. References owner. Referenced by ReentrantLock::getHoldCount(). |
|
Definition at line 165 of file ReentrantLock.d. Referenced by ReentrantLock::isLocked(). |
|
Creates a new Definition at line 238 of file LockImpl.d. |
|
Definition at line 448 of file LockImpl.d. References AbstractLock::head. Referenced by AbstractLock::acquireQueued(), AbstractLock::doAcquireNanos(), AbstractLock::doAcquireShared(), AbstractLock::doAcquireSharedNanos(), and AbstractLock::hasContended(). |
|
Definition at line 449 of file LockImpl.d. References AbstractLock::head. |
|
Definition at line 456 of file LockImpl.d. References AbstractLock::tail. Referenced by AbstractLock::addWaiter(), AbstractLock::enq(), AbstractLock::findNodeFromTail(), AbstractLock::getExclusiveQueuedThreads(), AbstractLock::getQueuedThreads(), AbstractLock::getQueueLength(), AbstractLock::getSharedQueuedThreads(), and AbstractLock::isQueued(). |
|
Definition at line 457 of file LockImpl.d. References AbstractLock::tail. |
|
Returns the current value of synchronization state. This operation has memory semantics of a
Definition at line 469 of file LockImpl.d. References AbstractLock::state_. Referenced by AbstractLock::fullyRelease(), and AbstractLock::toString(). |
|
Sets the value of synchronization state. This operation has memory semantics of a
Definition at line 478 of file LockImpl.d. References AbstractLock::state_. |
|
Attempts to acquire in exclusive mode. This method should query if the state of the object permits it to be acquired in the exclusive mode, and if so to acquire it. This method is always invoked by the thread performing acquire. If this method reports failure, the acquire method may queue the thread, if it is not already queued, until it is signalled by a release from some other thread. This can be used to implement method tryLock(). The default implementation throws UnsupportedOperationException
Reimplemented in ReentrantReadWriteLock::NonfairSync, ReentrantReadWriteLock::FairSync, ReentrantLock::NonfairSync, and ReentrantLock::FairSync. Definition at line 819 of file LockImpl.d. Referenced by AbstractLock::acquire(), AbstractLock::acquireQueued(), AbstractLock::doAcquireNanos(), and AbstractLock::tryAcquireNanos(). |
|
Attempts to acquire in shared mode. This method should query if the state of the object permits it to be acquired in the shared mode, and if so to acquire it. This method is always invoked by the thread performing acquire. If this method reports failure, the acquire method may queue the thread, if it is not already queued, until it is signalled by a release from some other thread. The default implementation throws UnsupportedOperationException
Reimplemented in CountDownLatch::Sync, ReentrantReadWriteLock::NonfairSync, ReentrantReadWriteLock::FairSync, Semaphore::NonfairSync, and Semaphore::FairSync. Definition at line 870 of file LockImpl.d. Referenced by AbstractLock::acquireShared(), AbstractLock::doAcquireShared(), AbstractLock::doAcquireSharedNanos(), and AbstractLock::tryAcquireSharedNanos(). |
|
Attempts to set the state to reflect a release in shared mode. This method is always invoked by the thread performing release. The default implementation throws UnsupportedOperationException.
Reimplemented in CountDownLatch::Sync, ReentrantReadWriteLock::Sync, and Semaphore::Sync. Definition at line 890 of file LockImpl.d. Referenced by AbstractLock::releaseShared(). |
|
Acquires in exclusive mode. Implemented by invoking at least once tryAcquire, returning on success. Otherwise the thread is queued, possibly repeatedly blocking and unblocking, invoking tryAcquire until success. This method can be used to implement method Lock.lock
Definition at line 924 of file LockImpl.d. References AbstractLock::acquireQueued(), AbstractLock::addWaiter(), and AbstractLock::tryAcquire(). Referenced by ReentrantLock::FairSync::lock(), ReentrantLock::NonfairSync::lock(), ReentrantReadWriteLock::FairSync::wlock(), and ReentrantReadWriteLock::NonfairSync::wlock(). |
|
Attempts to acquire in exclusive mode and failing if the given timeout elapses. Implemented by first checking interrupt status, then invoking at least once tryAcquire, returning on success. Otherwise, the thread is queued, possibly repeatedly blocking and unblocking, invoking tryAcquire until success or the timeout elapses. This method can be used to implement method Lock.tryLock(long, TimeUnit).
Definition at line 944 of file LockImpl.d. References AbstractLock::doAcquireNanos(), and AbstractLock::tryAcquire(). Referenced by ReentrantLock::tryLock(), and ReentrantReadWriteLock::WriteLock::tryLock(). |
|
Releases in exclusive mode. Implemented by unblocking one or more threads if tryRelease returns true. This method can be used to implement method Lock.unlock
Definition at line 959 of file LockImpl.d. References AbstractLock::head, AbstractLock::tryRelease(), AbstractLock::unparkSuccessor(), and AbstractLock::Node::waitStatus. Referenced by AbstractLock::fullyRelease(), ReentrantLock::unlock(), and ReentrantReadWriteLock::WriteLock::unlock(). |
|
Acquires in shared mode. Implemented by first invoking at least once tryAcquireShared, returning on success. Otherwise the thread is queued, possibly repeatedly blocking and unblocking, invoking tryAcquireShared until success.
Definition at line 981 of file LockImpl.d. References AbstractLock::doAcquireShared(), and AbstractLock::tryAcquireShared(). Referenced by Semaphore::acquire(), ReentrantReadWriteLock::ReadLock::lock(), and CountDownLatch::wait(). |
|
Attempts to acquire in shared mode and failing if the given timeout elapses. Implemented by invoking at least once tryAcquireShared, returning on success. Otherwise, the thread is queued, possibly repeatedly blocking and unblocking, invoking tryAcquireShared until success or the timeout elapses.
Definition at line 999 of file LockImpl.d. References AbstractLock::doAcquireSharedNanos(), and AbstractLock::tryAcquireShared(). Referenced by Semaphore::tryAcquire(), ReentrantReadWriteLock::ReadLock::tryLock(), and CountDownLatch::wait(). |
|
Releases in shared mode. Implemented by unblocking one or more threads if tryReleaseShared returns true.
Definition at line 1012 of file LockImpl.d. References AbstractLock::head, AbstractLock::tryReleaseShared(), AbstractLock::unparkSuccessor(), and AbstractLock::Node::waitStatus. Referenced by CountDownLatch::countDown(), Semaphore::release(), and ReentrantReadWriteLock::ReadLock::unlock(). |
|
Queries whether any threads are waiting to acquire. Note that because cancellations due to interrupts and timeouts may occur at any time, a In this implementation, this operation returns in constant time.
Definition at line 1038 of file LockImpl.d. References AbstractLock::head, and AbstractLock::tail. Referenced by Semaphore::hasQueuedThreads(), ReentrantLock::hasQueuedThreads(), ReentrantReadWriteLock::hasQueuedThreads(), and AbstractLock::toString(). |
|
Queries whether any threads have ever contended to acquire this synchronizer; that is if an acquire method has ever blocked. In this implementation, this operation returns in constant time.
Definition at line 1051 of file LockImpl.d. References AbstractLock::v_head(). |
|
Returns the first (longest-waiting) thread in the queue, or In this implementation, this operation normally returns in constant time, but may iterate upon contention if other threads are concurrently modifying the queue.
Definition at line 1066 of file LockImpl.d. References AbstractLock::fullGetFirstQueuedThread(), AbstractLock::head, and AbstractLock::tail. Referenced by ReentrantLock::FairSync::tryAcquire(), ReentrantReadWriteLock::FairSync::tryAcquire(), Semaphore::FairSync::tryAcquireShared(), and ReentrantReadWriteLock::FairSync::tryAcquireShared(). |
|
Definition at line 101 of file ReentrantLock.d. Referenced by getHoldCount(), getOwner(), isHeldExclusively(), nonfairTryAcquire(), and tryRelease(). |
|
The synchronization state. Definition at line 462 of file LockImpl.d. Referenced by AbstractLock::state(). |