Class NonFairReentrantLock

java.lang.Object
org.eclipse.net4j.util.concurrent.NonFairReentrantLock
All Implemented Interfaces:
Serializable, Lock
Direct Known Subclasses:
DelegableReentrantLock

public class NonFairReentrantLock extends Object implements Lock, Serializable
Since:
3.6
Author:
Eike Stepper
See Also:
  • Constructor Details

    • NonFairReentrantLock

      public NonFairReentrantLock()
  • Method Details

    • lock

      public void lock()
      Specified by:
      lock in interface Lock
    • lockInterruptibly

      public void lockInterruptibly() throws InterruptedException
      Specified by:
      lockInterruptibly in interface Lock
      Throws:
      InterruptedException
    • tryLock

      public boolean tryLock()
      Specified by:
      tryLock in interface Lock
    • tryLock

      public boolean tryLock(long timeout, TimeUnit unit) throws InterruptedException
      Specified by:
      tryLock in interface Lock
      Throws:
      InterruptedException
    • unlock

      public void unlock()
      Specified by:
      unlock in interface Lock
    • newCondition

      public Condition newCondition()
      Specified by:
      newCondition in interface Lock
    • getHoldCount

      public int getHoldCount()
    • isHeldByCurrentThread

      public boolean isHeldByCurrentThread()
    • isLocked

      public boolean isLocked()
    • getOwner

      public Thread getOwner()
    • hasQueuedThreads

      public final boolean hasQueuedThreads()
    • hasQueuedThread

      public final boolean hasQueuedThread(Thread thread)
    • getQueueLength

      public final int getQueueLength()
    • hasWaiters

      public boolean hasWaiters(Condition condition)
    • getWaitQueueLength

      public int getWaitQueueLength(Condition condition)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getQueuedThreads

      protected Collection<Thread> getQueuedThreads()
    • getWaitingThreads

      protected Collection<Thread> getWaitingThreads(Condition condition)
    • isOwner

      protected boolean isOwner(Thread thread, Thread owner)