public void run() { super.run(); // ICommand[] commands = null; Future<Void> idf = null; synchronized(AsyncExecutionService.this) { synchronized(this) { // isRunning() refers to running state of executor! // Do not remove when a new executor has already been added for the task. if(!this.isRunning() && executors!=null && executors.get(task)==this) { idf = removeTask(task); } } } if(idf!=null) idf.setResult(null); // for(int i=0; commands!=null && i<commands.length; i++) // { // commands[i].execute(null); // } } };