Package org.spongepowered.asm.util
Class ReEntranceLock
- java.lang.Object
-
- org.spongepowered.asm.util.ReEntranceLock
-
public class ReEntranceLock extends java.lang.ObjectRe-entrance semaphore used to share re-entrance data with the metadata service
-
-
Constructor Summary
Constructors Constructor Description ReEntranceLock(int maxDepth)
-
Method Summary
All Methods Instance Methods Concrete Methods 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 semaphore
-
-
-
Method Detail
-
getMaxDepth
public int getMaxDepth()
Get max depth
-
getDepth
public int getDepth()
Get current depth
-
push
public ReEntranceLock push()
Increase the re-entrance depth counter and set the semaphore if depth exceeds max depth- Returns:
- fluent interface
-
pop
public ReEntranceLock 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
public ReEntranceLock set()
Set the semaphore- Returns:
- fluent interface
-
isSet
public boolean isSet()
Get whether the semaphore is set
-
clear
public ReEntranceLock clear()
Clear the semaphore- Returns:
- fluent interface
-
-