Groovy Documentation

org.codehaus.groovy.util
[Java] Class LockableObject

java.lang.Object
  java.util.concurrent.locks.AbstractOwnableSynchronizer
      java.util.concurrent.locks.AbstractQueuedSynchronizer
          org.codehaus.groovy.util.LockableObject

public class LockableObject
extends java.util.concurrent.locks.AbstractQueuedSynchronizer

A bit simplified lock designed to be inherited by.


Method Summary
protected boolean isHeldExclusively()

void lock()

protected boolean tryAcquire(int acquires)

protected boolean tryRelease(int releases)

void unlock()

 
Methods inherited from class java.util.concurrent.locks.AbstractQueuedSynchronizer
java.util.concurrent.locks.AbstractQueuedSynchronizer#toString(), java.util.concurrent.locks.AbstractQueuedSynchronizer#acquireInterruptibly(int), java.util.concurrent.locks.AbstractQueuedSynchronizer#getQueueLength(), java.util.concurrent.locks.AbstractQueuedSynchronizer#getQueuedThreads(), java.util.concurrent.locks.AbstractQueuedSynchronizer#getWaitQueueLength(java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject), java.util.concurrent.locks.AbstractQueuedSynchronizer#getWaitingThreads(java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject), java.util.concurrent.locks.AbstractQueuedSynchronizer#hasQueuedThreads(), java.util.concurrent.locks.AbstractQueuedSynchronizer#hasWaiters(java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject), java.util.concurrent.locks.AbstractQueuedSynchronizer#isQueued(java.lang.Thread), java.util.concurrent.locks.AbstractQueuedSynchronizer#release(int), java.util.concurrent.locks.AbstractQueuedSynchronizer#tryAcquireNanos(int, long), java.util.concurrent.locks.AbstractQueuedSynchronizer#acquire(int), java.util.concurrent.locks.AbstractQueuedSynchronizer#acquireShared(int), java.util.concurrent.locks.AbstractQueuedSynchronizer#acquireSharedInterruptibly(int), java.util.concurrent.locks.AbstractQueuedSynchronizer#getExclusiveQueuedThreads(), java.util.concurrent.locks.AbstractQueuedSynchronizer#getFirstQueuedThread(), java.util.concurrent.locks.AbstractQueuedSynchronizer#getSharedQueuedThreads(), java.util.concurrent.locks.AbstractQueuedSynchronizer#hasContended(), java.util.concurrent.locks.AbstractQueuedSynchronizer#hasQueuedPredecessors(), java.util.concurrent.locks.AbstractQueuedSynchronizer#owns(java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject), java.util.concurrent.locks.AbstractQueuedSynchronizer#releaseShared(int), java.util.concurrent.locks.AbstractQueuedSynchronizer#tryAcquireSharedNanos(int, long), java.util.concurrent.locks.AbstractQueuedSynchronizer#wait(long, int), java.util.concurrent.locks.AbstractQueuedSynchronizer#wait(long), java.util.concurrent.locks.AbstractQueuedSynchronizer#wait(), java.util.concurrent.locks.AbstractQueuedSynchronizer#equals(java.lang.Object), java.util.concurrent.locks.AbstractQueuedSynchronizer#hashCode(), java.util.concurrent.locks.AbstractQueuedSynchronizer#getClass(), java.util.concurrent.locks.AbstractQueuedSynchronizer#notify(), java.util.concurrent.locks.AbstractQueuedSynchronizer#notifyAll()
 
Methods inherited from class java.util.concurrent.locks.AbstractOwnableSynchronizer
java.util.concurrent.locks.AbstractOwnableSynchronizer#wait(long, int), java.util.concurrent.locks.AbstractOwnableSynchronizer#wait(long), java.util.concurrent.locks.AbstractOwnableSynchronizer#wait(), java.util.concurrent.locks.AbstractOwnableSynchronizer#equals(java.lang.Object), java.util.concurrent.locks.AbstractOwnableSynchronizer#toString(), java.util.concurrent.locks.AbstractOwnableSynchronizer#hashCode(), java.util.concurrent.locks.AbstractOwnableSynchronizer#getClass(), java.util.concurrent.locks.AbstractOwnableSynchronizer#notify(), java.util.concurrent.locks.AbstractOwnableSynchronizer#notifyAll()
 

Method Detail

isHeldExclusively

protected final boolean isHeldExclusively()


lock

public final void lock()


tryAcquire

protected final boolean tryAcquire(int acquires)


tryRelease

protected final boolean tryRelease(int releases)


unlock

public final void unlock()


 

Groovy Documentation