public int wakeWaitingProcedures(ProcedureScheduler scheduler) {
    int count = queue.size();
    // wakeProcedure adds to the front of queue, so we start from last in the waitQueue' queue, so
    // that the procedure which was added first goes in the front for the scheduler queue.
    scheduler.addFront(queue.descendingIterator());
    queue.clear();
    return count;
  }
Returns whether we should wake the procedures waiting on the lock here.
hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/LockAndQueue.java