public void haltAllTasks(){
  LinkedList<Thread> endingThreads=new LinkedList<>();
  endingThreads.addAll(executions.values());
  for (  Thread thread : endingThreads) {
    while (thread.isAlive() && thread != Thread.currentThread()) {
      LOGGER.info("Interrupting execution thread " + thread);
      thread.interrupt();
    }
  }
  executions.clear();
}

public void haltAllTasks ( ) { LinkedList < Thread > endingThreads = new LinkedList < > ( ) ; endingThreads . addAll ( executions . values ( ) ) ; for ( Thread thread : endingThreads ) { while ( thread . isAlive ( ) && thread != Thread . currentThread ( ) ) { LOGGER . info ( "Interrupting execution thread " + thread ) ; thread . interrupt ( ) ; } } executions . clear ( ) ; }
interrupt all currently executing tasks , and clear the record of all executing tasks
