Package org.spiderwiz.zutils
Class ZLock
java.lang.Object
java.util.concurrent.locks.ReentrantReadWriteLock
org.spiderwiz.zutils.ZLock
- All Implemented Interfaces:
Serializable,ReadWriteLock
public final class ZLock extends ReentrantReadWriteLock
An implementation of
ReentrantReadWriteLock with an easier read-write lock mechanism.- See Also:
- Serialized Form
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.concurrent.locks.ReentrantReadWriteLock
ReentrantReadWriteLock.ReadLock, ReentrantReadWriteLock.WriteLock -
Constructor Summary
-
Method Summary
Modifier and Type Method Description voidlockRead()Locks this lock for reading.voidlockWrite()Locks this lock for writing.voidunlockRead()Unlocks this lock after being locked for reading.voidunlockWrite()Unlock this lock after being locked for writing.Methods inherited from class java.util.concurrent.locks.ReentrantReadWriteLock
getOwner, getQueuedReaderThreads, getQueuedThreads, getQueuedWriterThreads, getQueueLength, getReadHoldCount, getReadLockCount, getWaitingThreads, getWaitQueueLength, getWriteHoldCount, hasQueuedThread, hasQueuedThreads, hasWaiters, isFair, isWriteLocked, isWriteLockedByCurrentThread, readLock, toString, writeLock
-
Constructor Details
-
Method Details
-
lockRead
public void lockRead()Locks this lock for reading. -
unlockRead
public void unlockRead()Unlocks this lock after being locked for reading. -
lockWrite
public void lockWrite()Locks this lock for writing. -
unlockWrite
public void unlockWrite()Unlock this lock after being locked for writing.
-