public synchronized void wakeInternal(AbstractProcedureScheduler procedureScheduler) {
    if (ready && !suspendedProcedures.isEmpty()) {
      LOG.warn("Found procedures suspended in a ready event! Size=" + suspendedProcedures.size());
    }
    ready = true;
    if (LOG.isTraceEnabled()) {
      LOG.trace("Unsuspend " + toString());
    }
    // 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.
    procedureScheduler.addFront(suspendedProcedures.descendingIterator());
    suspendedProcedures.clear();
  }
Only to be used by ProcedureScheduler implementations. Reason: To wake up multiple events,
locking sequence is schedLock --> synchronized (event) To wake up an event, both schedLock()
and synchronized(event) are required. The order is schedLock() --> synchronized(event) because
when waking up multiple events simultaneously, we keep the scheduler locked until all
procedures suspended on these events have been added back to the queue (Maybe it's not
required? Evaluate!) To avoid deadlocks, we want to keep the locking order same even when
waking up single event. That's why, {@link #wake(AbstractProcedureScheduler)} above uses the
same code path as used when waking up multiple events. Access should remain package-private.
hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/ProcedureEvent.java