|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.javagroups.util.RWLock
Lock allowing multiple reads or a single write. Waiting writes have priority over new reads.
Code derived from com.sun.jini.thread.ReadersWriter, Jini 1.1, Sun Microsystems
Nested Class Summary | |
static class |
RWLock.BlockException
Exception thrown when a lock request would block the caller |
static class |
RWLock.IntException
Interrupted exception wrapped in a RuntimeException |
Constructor Summary | |
RWLock()
|
Method Summary | |
void |
readLock()
Obtain a read lock |
void |
readLockNoBlock()
Obtain the read lock immediatelly or throw an exception if an attempt to get the read lock would block this call |
void |
readUnlock()
Revoke the read lock |
void |
writeLock()
Obtain a write lock |
void |
writeLockNoBlock()
Obtain the write lock immediatelly or throw an exception if an attempt to get the write lock would block this call |
void |
writeUnlock()
Revoke the write lock |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public RWLock()
Method Detail |
public void readLock()
RWLock.IntException
- if interrupted while waiting on the lockpublic void readUnlock()
public void readLockNoBlock() throws RWLock.BlockException
RWLock.BlockException
- if attempt to get the read lock would block this callpublic void writeLock()
RWLock.IntException
- if interrupted while waiting on the lockpublic void writeUnlock()
public void writeLockNoBlock() throws RWLock.BlockException
RWLock.BlockException
- if attempt to get the write lock would block this
call
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |