Inheritance diagram for ReentrantReadWriteLock::Sync:
Public Member Functions | |
void | wlock () |
bool | nonfairTryAcquire (int acquires) |
int | nonfairTryAcquireShared (int acquires) |
Public Attributes | |
Thread | owner |
Protected Member Functions | |
final bool | tryRelease (int releases) |
final bool | tryReleaseShared (int releases) |
bool | isHeldExclusively () |
ConditionObject | newCondition () |
Thread | getOwner () |
int | getReadLockCount () |
bool | isWriteLocked () |
int | getWriteHoldCount () |
int | getCount () |
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) |
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 ReentrantReadWriteLock::NonfairSync, and ReentrantReadWriteLock::FairSync. Referenced by ReentrantReadWriteLock::WriteLock::lock(). |
|
Definition at line 254 of file ReadWriteLock.d. References Exception, ReentrantReadWriteLock::exclusiveCount(), and owner. Referenced by ReentrantReadWriteLock::NonfairSync::tryAcquire(), and ReentrantReadWriteLock::WriteLock::tryLock(). |
|
Definition at line 273 of file ReadWriteLock.d. References Exception, ReentrantReadWriteLock::exclusiveCount(), and owner. Referenced by ReentrantReadWriteLock::NonfairSync::tryAcquireShared(), and ReentrantReadWriteLock::ReadLock::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 288 of file ReadWriteLock.d. References Exception, ReentrantReadWriteLock::exclusiveCount(), and owner. |
|
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 from AbstractLock. Definition at line 303 of file ReadWriteLock.d. References Exception. |
|
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 314 of file ReadWriteLock.d. References ReentrantReadWriteLock::exclusiveCount(), and owner. Referenced by ReentrantReadWriteLock::isWriteLockedByCurrentThread(). |
|
Definition at line 321 of file ReadWriteLock.d. Referenced by ReentrantReadWriteLock::WriteLock::newCondition(). |
|
Definition at line 325 of file ReadWriteLock.d. References ReentrantReadWriteLock::exclusiveCount(), and owner. Referenced by ReentrantReadWriteLock::getOwner(), and ReentrantReadWriteLock::WriteLock::toString(). |
|
Definition at line 331 of file ReadWriteLock.d. References ReentrantReadWriteLock::sharedCount(). Referenced by ReentrantReadWriteLock::getReadLockCount(), and ReentrantReadWriteLock::ReadLock::toString(). |
|
Definition at line 335 of file ReadWriteLock.d. References ReentrantReadWriteLock::exclusiveCount(). Referenced by ReentrantReadWriteLock::isWriteLocked(). |
|
Definition at line 339 of file ReadWriteLock.d. References ReentrantReadWriteLock::exclusiveCount(), and owner. Referenced by ReentrantReadWriteLock::getWriteHoldCount(). |
|
Definition at line 345 of file ReadWriteLock.d. Referenced by ReentrantReadWriteLock::toString(). |
|
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(). |
|
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 242 of file ReadWriteLock.d. Referenced by getOwner(), getWriteHoldCount(), isHeldExclusively(), nonfairTryAcquire(), nonfairTryAcquireShared(), and tryRelease(). |
|
The synchronization state. Definition at line 462 of file LockImpl.d. Referenced by AbstractLock::state(). |