net.wotonomy.foundation
Class NSMultiReaderLock
java.lang.Object
EDU.oswego.cs.dl.util.concurrent.WriterPreferenceReadWriteLock
EDU.oswego.cs.dl.util.concurrent.ReentrantWriterPreferenceReadWriteLock
net.wotonomy.foundation.NSMultiReaderLock
- All Implemented Interfaces:
- EDU.oswego.cs.dl.util.concurrent.ReadWriteLock, NSLocking
public class NSMultiReaderLock
- extends EDU.oswego.cs.dl.util.concurrent.ReentrantWriterPreferenceReadWriteLock
- implements NSLocking
A Read-Write lock that allows unlimited number of calling threads to
acquire read locks, but only one thread to acquire a write lock. It
is also reentrant, allowing each thread to re-acquire it's lock
recursively. For that reason it is somewhat slower, as there is a
hash lookup when attempting to acquire and release reader locks. Of
course a writer lock is quite a bit slower than a reader lock. A
write lock is mutally exclusive with read locks, though a thread
that has obtained a read-lock may be promoted to a write lock and
vice versa when conditions permit.
- Version:
- $Revision: 893 $
- Author:
- cgruber@israfil.net, $Author: cgruber $
| Nested classes/interfaces inherited from class EDU.oswego.cs.dl.util.concurrent.WriterPreferenceReadWriteLock |
EDU.oswego.cs.dl.util.concurrent.WriterPreferenceReadWriteLock.ReaderLock, EDU.oswego.cs.dl.util.concurrent.WriterPreferenceReadWriteLock.Signaller, EDU.oswego.cs.dl.util.concurrent.WriterPreferenceReadWriteLock.WriterLock |
| Fields inherited from class EDU.oswego.cs.dl.util.concurrent.ReentrantWriterPreferenceReadWriteLock |
IONE, readers_, writeHolds_ |
| Fields inherited from class EDU.oswego.cs.dl.util.concurrent.WriterPreferenceReadWriteLock |
activeReaders_, activeWriter_, readerLock_, waitingReaders_, waitingWriters_, writerLock_ |
| Methods inherited from class EDU.oswego.cs.dl.util.concurrent.ReentrantWriterPreferenceReadWriteLock |
allowReader, endRead, endWrite, startRead, startWrite |
| Methods inherited from class EDU.oswego.cs.dl.util.concurrent.WriterPreferenceReadWriteLock |
cancelledWaitingReader, cancelledWaitingWriter, readLock, startReadFromNewReader, startReadFromWaitingReader, startWriteFromNewWriter, startWriteFromWaitingWriter, writeLock |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
NSMultiReaderLock
public NSMultiReaderLock()
lockForReading
public void lockForReading()
unlockForReading
public void unlockForReading()
lock
public void lock()
- Specified by:
lock in interface NSLocking
lockForWriting
public void lockForWriting()
unlock
public void unlock()
- Specified by:
unlock in interface NSLocking
unlockForWriting
public void unlockForWriting()
suspendReaderLocks
public void suspendReaderLocks()
- See Also:
com.webobjects.foundation.NSMultiReaderLock#suspendReaderLock()
retrieveReaderLocks
public void retrieveReaderLocks()
- See Also:
com.webobjects.foundation.NSMultiReaderLock#retrieveReaderLock()
tryLockForWriting
public boolean tryLockForWriting()
tryLockForReading
public boolean tryLockForReading()
toString
public java.lang.String toString()
- Overrides:
toString in class java.lang.Object
_padString
protected java.lang.String _padString(long l,
int i)
_padString
protected java.lang.String _padString(java.lang.String s,
int i,
boolean flag)
Copyright © 2006 null. All Rights Reserved.