private void lock0(QueueEntry entry) throws ProcedureSuspendedException {
    lock.lock();
    try {
      for (;;) {
        if (owner == null) {
          owner = entry.getOwner();
          count = 1;
          return;
        }
        if (owner == entry.getOwner()) {
          count++;
          return;
        }
        waitingQueue.add(entry);
        entry.await();
      }
    } finally {
      lock.unlock();
    }
  }
Called when it is your turn to get the lock. For thread, just delegate the call to
condition's signal method, and for procedure, you should call the {@code wakeUp} action, to
add the procedure back to procedure scheduler.
hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/RegionStateNodeLock.java