|
|||||||||
前のクラス 次のクラス | フレームあり フレームなし | ||||||||
概要: 内部クラス | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |
java.lang.Object | +--org.apache.avalon.excalibur.concurrent.ReadWriteLock
Class implementing a read/write lock. The lock has three states - unlocked, locked for reading and locked for writing. If the lock is unlocked, anyone can aquire a read or write lock. If the lock is locked for reading, anyone can aquire a read lock, but no one can aquire a write lock. If the lock is locked for writing, no one can quire any type of lock.
When the lock is released, those threads attempting to aquire a write lock will take priority over those trying to get a read lock.
コンストラクタの概要 | |
ReadWriteLock()
Default constructor. |
メソッドの概要 | |
void |
aquireRead()
Attempts to aquire a read lock. |
void |
aquireWrite()
Attempts to aquire a write lock. |
void |
release()
Releases a lock. |
boolean |
tryAquireRead()
Attempts to aquire a read lock. |
boolean |
tryAquireWrite()
Attempts to aquire a write lock. |
クラス java.lang.Object から継承したメソッド |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
コンストラクタの詳細 |
public ReadWriteLock()
メソッドの詳細 |
public void aquireRead() throws java.lang.InterruptedException
java.lang.InterruptedException
- if the thread is interrupted while waiting for
a lock.public void aquireWrite() throws java.lang.InterruptedException
java.lang.InterruptedException
- if the thread is interrupted while waiting for
a lock.public void release()
java.lang.IllegalStateException
- when an attempt is made to release
an unlocked lock.public boolean tryAquireRead()
true
iff the lock was successfully obtained.public boolean tryAquireWrite()
true
iff the lock was successfully obtained.
|
|||||||||
前のクラス 次のクラス | フレームあり フレームなし | ||||||||
概要: 内部クラス | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |