Package org.boxutil.util.concurrent
Class ReentrantSpinLock
java.lang.Object
org.boxutil.util.concurrent.ReentrantSpinLock
- All Implemented Interfaces:
Lock
-
Field Details
-
_ref
-
-
Constructor Details
-
ReentrantSpinLock
public ReentrantSpinLock()
-
-
Method Details
-
lock
public void lock() -
unlock
public void unlock() -
lockInterruptibly
- Specified by:
lockInterruptiblyin interfaceLock- Throws:
InterruptedException
-
tryLock
public boolean tryLock() -
tryLock
- Specified by:
tryLockin interfaceLock- Throws:
InterruptedException
-
newCondition
- Specified by:
newConditionin interfaceLock
-
getOwner
-
isLocked
public boolean isLocked() -
getHeldCount
public int getHeldCount()- Returns:
- returns
Integer.MIN_VALUEif not held by any thread.
-