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
public class NonReentrantLock extends AbstractQueuedSynchronizer implements Lock
Non reentrant lock. Copied from Netty 3.7 sources.- Since:
- 5.6.1
- Author:
- Philip Helger
- 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 NonReentrantLock()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanisHeldByCurrentThread()protected booleanisHeldExclusively()voidlock()voidlockInterruptibly()ConditionnewCondition()protected booleantryAcquire(int acquires)booleantryLock()booleantryLock(long nTime, TimeUnit eUnit)protected 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, tryReleaseShared
-
Methods inherited from class java.util.concurrent.locks.AbstractOwnableSynchronizer
getExclusiveOwnerThread, setExclusiveOwnerThread
-
-
-
-
Method Detail
-
lockInterruptibly
public void lockInterruptibly() throws InterruptedException- Specified by:
lockInterruptiblyin interfaceLock- Throws:
InterruptedException
-
tryLock
public boolean tryLock(long nTime, TimeUnit eUnit) throws InterruptedException- Specified by:
tryLockin interfaceLock- Throws:
InterruptedException
-
isHeldByCurrentThread
public boolean isHeldByCurrentThread()
-
newCondition
@Nonnull public Condition 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
-
-