Package org.spongepowered.asm.util
Class ReEntranceLock
java.lang.Object
org.spongepowered.asm.util.ReEntranceLock
public class ReEntranceLock
extends java.lang.Object
Re-entrance semaphore used to share re-entrance data with the metadata
service
-
Constructor Summary
Constructors Constructor Description ReEntranceLock(int maxDepth) -
Method Summary
Modifier and Type Method Description booleancheck()Run the depth check but do not set the semaphorebooleancheckAndSet()Run the depth check and set the semaphore if depth is exceededReEntranceLockclear()Clear the semaphoreintgetDepth()Get current depthintgetMaxDepth()Get max depthbooleanisSet()Get whether the semaphore is setReEntranceLockpop()Decrease the re-entrance depthReEntranceLockpush()Increase the re-entrance depth counter and set the semaphore if depth exceeds max depthReEntranceLockset()Set the semaphoreMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
ReEntranceLock
public ReEntranceLock(int maxDepth)
-
-
Method Details
-
getMaxDepth
public int getMaxDepth()Get max depth -
getDepth
public int getDepth()Get current depth -
push
Increase the re-entrance depth counter and set the semaphore if depth exceeds max depth- Returns:
- fluent interface
-
pop
Decrease the re-entrance depth- Returns:
- fluent interface
-
check
public boolean check()Run the depth check but do not set the semaphore- Returns:
- true if depth has exceeded max
-
checkAndSet
public boolean checkAndSet()Run the depth check and set the semaphore if depth is exceeded- Returns:
- true if semaphore is set
-
set
Set the semaphore- Returns:
- fluent interface
-
isSet
public boolean isSet()Get whether the semaphore is set -
clear
Clear the semaphore- Returns:
- fluent interface
-