Inheritance diagram for ReentrantReadWriteLock::ReadLock:
Public Member Functions | |
this (ReentrantReadWriteLock lock) | |
void | lock () |
bool | tryLock () |
bool | tryLock (long timeout, TimeUnit unit) |
void | unlock () |
Condition | newCondition () |
char[] | toString () |
Private Attributes | |
Sync | sync |
Definition at line 420 of file ReadWriteLock.d.
|
Constructor for use by subclasses
Definition at line 427 of file ReadWriteLock.d. |
|
Acquires the shared lock. Acquires the lock if it is not held exclusively by another thread and returns immediately. If the lock is held exclusively by another thread then the current thread becomes disabled for thread scheduling purposes and lies dormant until the lock has been acquired. Reimplemented from Lock. Definition at line 441 of file ReadWriteLock.d. References AbstractLock::acquireShared(), and sync. Referenced by this(). |
|
Acquires the shared lock only if it is not held exclusively by another thread at the time of invocation.
Acquires the lock if it is not held exclusively by another thread and returns immediately with the value
If the lock is held exclusively by another thread then this method will return immediately with the value
'return Reimplemented from Lock. Definition at line 467 of file ReadWriteLock.d. References ReentrantReadWriteLock::Sync::nonfairTryAcquireShared(), and sync. |
|
Acquires the shared lock if it is not held exclusively by another thread within the given waiting time.
Acquires the lock if it is not held exclusively by another thread and returns immediately with the value
if (lock.tryLock() || lock.tryLock(timeout, unit) ) { ... } If the lock is held exclusively by another thread then the current thread becomes disabled for thread scheduling purposes and lies dormant until one of three things happens:
If the lock is acquired then the value
If the specified waiting time elapses then the value
Reimplemented from Lock. Definition at line 510 of file ReadWriteLock.d. References sync, toNanos(), and AbstractLock::tryAcquireSharedNanos(). |
|
Attempts to release this lock. If the number of readers is now zero then the lock is made available for other lock attempts. Reimplemented from Lock. Definition at line 520 of file ReadWriteLock.d. References AbstractLock::releaseShared(), and sync. |
|
Throws UnsupportedOperationException because ReadLocks do not support conditions.
Reimplemented from Lock. Definition at line 529 of file ReadWriteLock.d. |
|
Returns a string identifying this lock, as well as its lock state. The state, in brackets, includes the String "Read locks =" followed by the number of held read locks.
Definition at line 541 of file ReadWriteLock.d. References ReentrantReadWriteLock::Sync::getReadLockCount(), and sync. |
|
Definition at line 421 of file ReadWriteLock.d. Referenced by lock(), this(), toString(), tryLock(), and unlock(). |