Package org.spongepowered.asm.util
Class ReEntranceLock
java.lang.Object
org.spongepowered.asm.util.ReEntranceLock
Re-entrance semaphore used to share re-entrance data with the metadata
service
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancheck()Run the depth check but do not set the semaphorebooleanRun the depth check and set the semaphore if depth is exceededclear()Clear the semaphoreintgetDepth()Get current depthintGet max depthbooleanisSet()Get whether the semaphore is setpop()Decrease the re-entrance depthpush()Increase the re-entrance depth counter and set the semaphore if depth exceeds max depthset()Set the semaphore
-
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
-