|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.rice.cs.util.ReaderWriterLock.ReaderWriterThread
public abstract class ReaderWriterLock.ReaderWriterThread
Represents a thread waiting to either read or write. Instances of this class are placed in a queue to enforce the correct order when allowing new threads to read or write. The waiting thread must call wait() on this object, allowing it to be notified when it reaches the front of the queue. This object will remain on the queue until the thread completes its read or write, allowing us to check for and prevent deadlock if the same thread tries to both read and write at the same time.
Constructor Summary | |
---|---|
ReaderWriterLock.ReaderWriterThread()
|
Method Summary | |
---|---|
abstract boolean |
isReader()
Returns whether this ReaderWriter is a reader. |
abstract boolean |
isWriter()
Returns whether this ReaderWriter is a writer. |
void |
startWaiting()
Causes this ReaderWriterThread to wait until stopWaiting is called. |
void |
stopWaiting()
Wakes up this ReaderWriterThread, removing it from the waitQueue. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ReaderWriterLock.ReaderWriterThread()
Method Detail |
---|
public abstract boolean isWriter()
public abstract boolean isReader()
public void startWaiting()
public void stopWaiting()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |