| |
|
| java.lang.Object com.hp.hpl.jena.shared.LockMRSW
All known Subclasses: com.hp.hpl.jena.rdf.model.impl.ModelLockImpl,
LockMRSW | public class LockMRSW implements Lock(Code) | | Lock implemenetation using a Multiple Reader, Single Writer policy.
All the locking work is done by the imported WriterPreferenceReadWriteLock.
Ths class adds:
- The same thread that acquired a lock should release it
- Lock promotion (turning read locks into write locks) is
deteched as an error
author: Andy Seaborne version: $Id: LockMRSW.java,v 1.5 2008/01/02 12:06:11 andy_seaborne Exp $ |
Inner Class :static class LockState | |
Method Summary | |
final public void | enterCriticalSection(boolean readLockRequested) Application controlled locking - enter a critical section.
Locking is reentrant so an application can have nested critical sections.
Typical code:
try {
enterCriticalSection(Lock.READ) ;
... | synchronized LockState | getLockState() | final public void | leaveCriticalSection() Application controlled locking - leave a critical section. | synchronized void | removeLockState(Thread thread) |
activeReadLocks | SynchronizedInt activeReadLocks(Code) | | |
activeWriteLocks | SynchronizedInt activeWriteLocks(Code) | | |
mrswLock | WriterPreferenceReadWriteLock mrswLock(Code) | | |
threadStatesSize | int threadStatesSize(Code) | | |
LockMRSW | public LockMRSW()(Code) | | |
enterCriticalSection | final public void enterCriticalSection(boolean readLockRequested)(Code) | | Application controlled locking - enter a critical section.
Locking is reentrant so an application can have nested critical sections.
Typical code:
try {
enterCriticalSection(Lock.READ) ;
... application code ...
} finally { leaveCriticalSection() ; }
|
getLockState | synchronized LockState getLockState()(Code) | | |
removeLockState | synchronized void removeLockState(Thread thread)(Code) | | |
|
|
|