@Override
      public void signal() {
        // Here we need to set the owner to the procedure directly.
        // For thread, we just block inside the lock0 method, so after signal we will continue and
        // get the lock
        // For procedure, the waking up here is actually a reschedule of the procedure to
        // ProcedureExecutor, so here we need to set the owner first, and it is the procedure's duty
        // to make sure that it has already hold the lock so do not need to call lock again, usually
        // this should be done by calling isLockedBy method below
        assert owner == null;
        assert count == 0;
        owner = proc;
        count = 1;
        wakeUp.run();
      }
Lock by a procedure. You can release the lock in another thread.
<p>
When the procedure can not get the lock immediately, a ProcedureSuspendedException will be
thrown to suspend the procedure. And when we want to wake up a procedure, we will call the
{@code wakeUp} action. Usually in the {@code wakeUp} action you should add the procedure back
to procedure scheduler.
hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/RegionStateNodeLock.java