private void cancelAllChores(final boolean mayInterruptIfRunning) {
    // Build list of chores to cancel so we can iterate through a set that won't change
    // as chores are cancelled. If we tried to cancel each chore while iterating through
    // keySet the results would be undefined because the keySet would be changing
    ArrayList<ScheduledChore> choresToCancel = new ArrayList<>(scheduledChores.keySet());

    for (ScheduledChore chore : choresToCancel) {
      cancelChore(chore, mayInterruptIfRunning);
    }
  }
Returns true when the service is shutdown and all threads have terminated
hbase-common/src/main/java/org/apache/hadoop/hbase/ChoreService.java