@Override
    public void unlock() {
      for (;;) {
        boolean interrupted = false;
        try {
          readerSemaphore.acquire();
        } catch (InterruptedException e) {
          interrupted = true;
          continue;
        } finally {
          if (interrupted) {
            Thread.currentThread().interrupt();
          }
        }
        numReaders--;
        // The unlock method is forgiving
        if (numReaders <= 0) {
          numReaders = 0;
          if (writerSemaphore.availablePermits() == 0) {
            writerSemaphore.release();
          }
        }
        readerSemaphore.release();
        break;
      }
    }
This ReadWriteLock is useful when different threads need to lock and unlock the read lock. This
is <b>NOT</b> a reentrant lock.
geode-core/src/main/java/org/apache/geode/internal/util/concurrent/SemaphoreReadWriteLock.java