private void checkForRentry() {
    if (isHeldByCurrentThread()) {
      throw new IllegalStateException(
          "Lock reentry is not allowed");
    }
  }
@throws IllegalStateException if reentry is detected
geode-core/src/main/java/org/apache/geode/internal/util/concurrent/StoppableNonReentrantLock.java