Inheritance diagram for ReentrantReadWriteLock::WriteLock:
Public Member Functions | |
this (ReentrantReadWriteLock lock) | |
void | lock () |
bool | tryLock () |
bool | tryLock (long timeout, TimeUnit unit) |
void | unlock () |
Condition | newCondition () |
char[] | toString () |
Private Attributes | |
final Sync | sync |
Definition at line 554 of file ReadWriteLock.d.
|
Constructor for use by subclasses
Definition at line 561 of file ReadWriteLock.d. |
|
Acquire the lock. Acquires the lock if it is not held by another thread and returns immediately, setting the lock hold count to one. If the current thread already holds the lock then the hold count is incremented by one and the method returns immediately. If the lock is held by another thread then the current thread becomes disabled for thread scheduling purposes and lies dormant until the lock has been acquired, at which time the lock hold count is set to one. Reimplemented from Lock. Definition at line 581 of file ReadWriteLock.d. References sync, and ReentrantReadWriteLock::Sync::wlock(). Referenced by this(). |
|
Acquires the lock only if it is not held by another thread at the time of invocation.
Acquires the lock if it is not held by another thread and returns immediately with the value
If the current thread already holds this lock then the hold count is incremented by one and the method returns
If the lock is held by another thread then this method will return immediately with the value
Reimplemented from Lock. Definition at line 612 of file ReadWriteLock.d. References ReentrantReadWriteLock::Sync::nonfairTryAcquire(), and sync. |
|
Acquires the lock if it is not held by another thread within the given waiting time.
Acquires the lock if it is not held by another thread and returns immediately with the value
if (lock.tryLock() || lock.tryLock(timeout, unit) ) { ... }
If the current thread already holds this lock then the hold count is incremented by one and the method returns If the lock is held 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 661 of file ReadWriteLock.d. References sync, toNanos(), and AbstractLock::tryAcquireNanos(). |
|
Attempts to release this lock. If the current thread is the holder of this lock then the hold count is decremented. If the hold count is now zero then the lock is released. Reimplemented from Lock. Definition at line 672 of file ReadWriteLock.d. References AbstractLock::release(), and sync. |
|
Returns a Condition instance for use with this Lock instance. The semantics are like the semantics of the Condition for a ReentrantLock.
Reimplemented from Lock. Definition at line 682 of file ReadWriteLock.d. References ReentrantReadWriteLock::Sync::newCondition(), and sync. |
|
Returns a string identifying this lock, as well as its lock state. The state, in brackets includes either the String "Unlocked" or the String "Locked by" followed by the Thread.toString of the owning thread.
Definition at line 693 of file ReadWriteLock.d. References ReentrantReadWriteLock::Sync::getOwner(), and sync. |
|
Definition at line 555 of file ReadWriteLock.d. Referenced by lock(), newCondition(), this(), toString(), tryLock(), and unlock(). |