public void lock() {
    for (;;) {
      boolean interrupted = Thread.interrupted();
      try {
        lockInterruptibly();
        break;
      } catch (InterruptedException e) {
        interrupted = true;
      } finally {
        if (interrupted) {
          Thread.currentThread().interrupt();
        }
      }
    } // for
  }
Create a new instance with given fairness and cancellation criterion

@param fair whether to be fair
@param stopper the cancellation criterion
geode-core/src/main/java/org/apache/geode/internal/util/concurrent/StoppableReentrantLock.java