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
`ReEntranceLock​(int maxDepth)`

### Method Summary

All Methods Instance Methods Concrete Methods
`boolean` `check()` Run the depth check but do not set the semaphore
`boolean` `checkAndSet()` Run the depth check and set the semaphore if depth is exceeded
`ReEntranceLock` `clear()` Clear the semaphore
`int` `getDepth()` Get current depth
`int` `getMaxDepth()` Get max depth
`boolean` `isSet()` Get whether the semaphore is set
`ReEntranceLock` `pop()` Decrease the re-entrance depth
`ReEntranceLock` `push()` Increase the re-entrance depth counter and set the semaphore if depth exceeds max depth
`ReEntranceLock` `set()` Set the semaphore

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### ReEntranceLock

    public ReEntranceLock​(int maxDepth)

### 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