LockableObject (Groovy 5.0.0)
Description: declaration: package: org.codehaus.groovy.util, class: LockableObject

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:
  `Serializable`

Direct Known Subclasses:
  `LazyReference`

public class LockableObject extends AbstractQueuedSynchronizer
A bit simplified lock designed to be inherited by.

See Also:
  - Serialized Form

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from class java.util.concurrent.locks.AbstractQueuedSynchronizer

  `AbstractQueuedSynchronizer.ConditionObject`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `LockableObject()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected final boolean`
  `isHeldExclusively()`
  `final void`
  `lock()`
  `protected final boolean`
  `tryAcquire(int acquires)`
  `protected final boolean`
  `tryRelease(int releases)`
  `final void`
  `unlock()`

  ### Methods inherited from class java.util.concurrent.locks.AbstractQueuedSynchronizer

  `acquire, 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, tryReleaseShared`

  ### Methods inherited from class java.util.concurrent.locks.AbstractOwnableSynchronizer

  `getExclusiveOwnerThread, setExclusiveOwnerThread`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### LockableObject

    public LockableObject()

- ## Method Details

  - ### isHeldExclusively

    protected final boolean isHeldExclusively()
    Overrides:
      `isHeldExclusively` in class `AbstractQueuedSynchronizer`

  - ### lock

    public final void lock()

  - ### unlock

    public final void unlock()

  - ### tryAcquire

    protected final boolean tryAcquire(int acquires)
    Overrides:
      `tryAcquire` in class `AbstractQueuedSynchronizer`

  - ### tryRelease

    protected final boolean tryRelease(int releases)
    Overrides:
      `tryRelease` in class `AbstractQueuedSynchronizer`