java.lang.Object
marauroa.RWLock
- public class RWLock
- extends java.lang.Object
This class is a Reader/Writters lock
A Reader Writer Lock is a synchronization mechanism allowing access to data.
It allows multiple threads to read the data simultaneously, but only one
thread at a time to update it. While a thread is updating, no other thread
can read the data. The name is misleading. It may cause you to think there
are two locks; in reality there is a single lock that restricts both reading
and writing.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
givenLocks
private int givenLocks
waitingWriters
private int waitingWriters
mutex
private java.lang.Object mutex
RWLock
public RWLock()
requestReadLock
public void requestReadLock()
requestWriteLock
public void requestWriteLock()
releaseLock
public void releaseLock()