Package org.codehaus.groovy.util
Class LockableObject
java.lang.Object
java.util.concurrent.locks.AbstractOwnableSynchronizer
java.util.concurrent.locks.AbstractQueuedSynchronizer
org.codehaus.groovy.util.LockableObject
- All Implemented Interfaces:
- java.io.Serializable
- Direct Known Subclasses:
- AbstractConcurrentMapBase.Segment,- LazyReference
public class LockableObject
extends java.util.concurrent.locks.AbstractQueuedSynchronizer
A bit simplified lock designed to be inherited by.
- See Also:
- Serialized Form
- 
Nested Class SummaryNested classes/interfaces inherited from class java.util.concurrent.locks.AbstractQueuedSynchronizerjava.util.concurrent.locks.AbstractQueuedSynchronizer.ConditionObject
- 
Constructor SummaryConstructors Constructor Description LockableObject()
- 
Method SummaryModifier and Type Method Description protected booleanisHeldExclusively()voidlock()protected booleantryAcquire(int acquires)protected booleantryRelease(int releases)voidunlock()Methods inherited from class java.util.concurrent.locks.AbstractQueuedSynchronizeracquire, acquireInterruptibly, acquireShared, acquireSharedInterruptibly, compareAndSetState, getExclusiveQueuedThreads, getFirstQueuedThread, getQueuedThreads, getQueueLength, getSharedQueuedThreads, getState, getWaitingThreads, getWaitQueueLength, hasContended, hasQueuedPredecessors, hasQueuedThreads, hasWaiters, isQueued, owns, release, releaseShared, setState, toString, tryAcquireNanos, tryAcquireShared, tryAcquireSharedNanos, tryReleaseSharedMethods inherited from class java.util.concurrent.locks.AbstractOwnableSynchronizergetExclusiveOwnerThread, setExclusiveOwnerThreadMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
- 
Constructor Details- 
LockableObjectpublic LockableObject()
 
- 
- 
Method Details- 
isHeldExclusivelyprotected final boolean isHeldExclusively()- Overrides:
- isHeldExclusivelyin class- java.util.concurrent.locks.AbstractQueuedSynchronizer
 
- 
lockpublic final void lock()
- 
unlockpublic final void unlock()
- 
tryAcquireprotected final boolean tryAcquire(int acquires)- Overrides:
- tryAcquirein class- java.util.concurrent.locks.AbstractQueuedSynchronizer
 
- 
tryReleaseprotected final boolean tryRelease(int releases)- Overrides:
- tryReleasein class- java.util.concurrent.locks.AbstractQueuedSynchronizer
 
 
-