Class ReEntranceLock

java.lang.Object
org.spongepowered.asm.util.ReEntranceLock

public class ReEntranceLock extends Object
Re-entrance semaphore used to share re-entrance data with the metadata service
  • Constructor Details

    • ReEntranceLock

      public ReEntranceLock(int maxDepth)
  • Method Details

    • 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