Package org.apache.jena.shared
Class LockMRPlusSW
java.lang.Object
java.util.concurrent.locks.ReentrantLock
org.apache.jena.shared.LockMRPlusSW
- All Implemented Interfaces:
Serializable
,Lock
,Lock
A multiple-reader plus single-writer lock. This lock permits readers to obtain their locks under any condition, but
allows only one writer at a time. Writers can acquire a read lock, and readers can acquire the write lock.
- See Also:
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
enterCriticalSection
(boolean readLockRequested) Enter a critical section.void
Leave a critical section.Methods inherited from class java.util.concurrent.locks.ReentrantLock
getHoldCount, getQueueLength, getWaitQueueLength, hasQueuedThread, hasQueuedThreads, hasWaiters, isFair, isHeldByCurrentThread, isLocked, lock, lockInterruptibly, newCondition, toString, tryLock, tryLock, unlock
-
Constructor Details
-
LockMRPlusSW
public LockMRPlusSW()
-
-
Method Details
-
enterCriticalSection
public void enterCriticalSection(boolean readLockRequested) Description copied from interface:Lock
Enter a critical section. The application must call leaveCriticialSection.- Specified by:
enterCriticalSection
in interfaceLock
- Parameters:
readLockRequested
- true implies a read lock, false implies write lock.- See Also:
-
leaveCriticalSection
public void leaveCriticalSection()Description copied from interface:Lock
Leave a critical section. Releases the lock form the matching enterCriticalSection- Specified by:
leaveCriticalSection
in interfaceLock
- See Also:
-