Package com.helger.commons.concurrent
Class NonReentrantLock
java.lang.Object
java.util.concurrent.locks.AbstractOwnableSynchronizer
java.util.concurrent.locks.AbstractQueuedSynchronizer
com.helger.commons.concurrent.NonReentrantLock
- All Implemented Interfaces:
Serializable,Lock
Non reentrant lock. Copied from Netty 3.7 sources.
- Since:
- 5.6.1
- Author:
- Philip Helger
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.concurrent.locks.AbstractQueuedSynchronizer
AbstractQueuedSynchronizer.ConditionObject -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanprotected booleanvoidlock()voidprotected booleantryAcquire(int acquires) booleantryLock()booleanprotected booleantryRelease(int releases) voidunlock()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, tryReleaseSharedMethods inherited from class java.util.concurrent.locks.AbstractOwnableSynchronizer
getExclusiveOwnerThread, setExclusiveOwnerThread
-
Constructor Details
-
NonReentrantLock
public NonReentrantLock()
-
-
Method Details
-
lock
public void lock() -
lockInterruptibly
- Specified by:
lockInterruptiblyin interfaceLock- Throws:
InterruptedException
-
tryLock
public boolean tryLock() -
tryLock
- Specified by:
tryLockin interfaceLock- Throws:
InterruptedException
-
unlock
public void unlock() -
isHeldByCurrentThread
public boolean isHeldByCurrentThread() -
newCondition
- Specified by:
newConditionin interfaceLock
-
tryAcquire
protected boolean tryAcquire(int acquires) - Overrides:
tryAcquirein classAbstractQueuedSynchronizer
-
tryRelease
protected boolean tryRelease(int releases) - Overrides:
tryReleasein classAbstractQueuedSynchronizer
-
isHeldExclusively
protected boolean isHeldExclusively()- Overrides:
isHeldExclusivelyin classAbstractQueuedSynchronizer
-