org.eclipse.net4j.util.concurrent

## Class NonFairReentrantLock

- java.lang.Object
- - org.eclipse.net4j.util.concurrent.NonFairReentrantLock

- All Implemented Interfaces:
    java.io.Serializable, java.util.concurrent.locks.Lock
  Direct Known Subclasses:
    DelegableReentrantLock

      public class NonFairReentrantLock
      extends java.lang.Object
      implements java.util.concurrent.locks.Lock, java.io.Serializable

  Since:
    3.6
  Author:
    Eike Stepper
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `NonFairReentrantLock()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `getHoldCount()`
    `java.lang.Thread` | `getOwner()`
    `protected java.util.Collection<java.lang.Thread>` | `getQueuedThreads()`
    `int` | `getQueueLength()`
    `protected java.util.Collection<java.lang.Thread>` | `getWaitingThreads(java.util.concurrent.locks.Condition condition)`
    `int` | `getWaitQueueLength(java.util.concurrent.locks.Condition condition)`
    `boolean` | `hasQueuedThread(java.lang.Thread thread)`
    `boolean` | `hasQueuedThreads()`
    `boolean` | `hasWaiters(java.util.concurrent.locks.Condition condition)`
    `boolean` | `isHeldByCurrentThread()`
    `boolean` | `isLocked()`
    `protected boolean` | `isOwner(java.lang.Thread thread, java.lang.Thread owner)`
    `void` | `lock()`
    `void` | `lockInterruptibly()`
    `java.util.concurrent.locks.Condition` | `newCondition()`
    `java.lang.String` | `toString()`
    `boolean` | `tryLock()`
    `boolean` | `tryLock(long timeout, java.util.concurrent.TimeUnit unit)`
    `void` | `unlock()`

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

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

- - ### Constructor Detail

    - #### NonFairReentrantLock

          public NonFairReentrantLock()

  - ### Method Detail

    - #### lock

          public void lock()

      Specified by:
        `lock` in interface `java.util.concurrent.locks.Lock`

    - #### lockInterruptibly

          public void lockInterruptibly()
                                 throws java.lang.InterruptedException

      Specified by:
        `lockInterruptibly` in interface `java.util.concurrent.locks.Lock`
      Throws:
        `java.lang.InterruptedException`

    - #### tryLock

          public boolean tryLock()

      Specified by:
        `tryLock` in interface `java.util.concurrent.locks.Lock`

    - #### tryLock

          public boolean tryLock(long timeout,
                                 java.util.concurrent.TimeUnit unit)
                          throws java.lang.InterruptedException

      Specified by:
        `tryLock` in interface `java.util.concurrent.locks.Lock`
      Throws:
        `java.lang.InterruptedException`

    - #### unlock

          public void unlock()

      Specified by:
        `unlock` in interface `java.util.concurrent.locks.Lock`

    - #### newCondition

          public java.util.concurrent.locks.Condition newCondition()

      Specified by:
        `newCondition` in interface `java.util.concurrent.locks.Lock`

    - #### getHoldCount

          public int getHoldCount()

    - #### isHeldByCurrentThread

          public boolean isHeldByCurrentThread()

    - #### isLocked

          public boolean isLocked()

    - #### getOwner

          public java.lang.Thread getOwner()

    - #### hasQueuedThreads

          public final boolean hasQueuedThreads()

    - #### hasQueuedThread

          public final boolean hasQueuedThread(java.lang.Thread thread)

    - #### getQueueLength

          public final int getQueueLength()

    - #### hasWaiters

          public boolean hasWaiters(java.util.concurrent.locks.Condition condition)

    - #### getWaitQueueLength

          public int getWaitQueueLength(java.util.concurrent.locks.Condition condition)

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`

    - #### getQueuedThreads

          protected java.util.Collection<java.lang.Thread> getQueuedThreads()

    - #### getWaitingThreads

          protected java.util.Collection<java.lang.Thread> getWaitingThreads(java.util.concurrent.locks.Condition condition)

    - #### isOwner

          protected boolean isOwner(java.lang.Thread thread,
                                    java.lang.Thread owner)

Copyright (c) 2014 Eike Stepper (Berlin, Germany) and others.
All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html