private boolean dropIfAlreadyScheduled(ExecutionBuilder.TaskWrapper wrapper) { synchronized (schedulerQueue) { for (ExecutionBuilder.TaskWrapper other : schedulerQueue) { if (wrapper.synchronizer.equals(other.synchronizer)) { wrapper.drop(); return true; } } } return false; }
private void executeNow(ExecutionBuilder.TaskWrapper wrapper) { wrapper.prepare(); AsyncExecutor exec = findExecutor(wrapper.category); wrapper.jobNumber = exec.executed.inc(); wrapper.durationAverage = exec.duration; if (wrapper.synchronizer != null) { scheduleTable.put(wrapper.synchronizer, System.currentTimeMillis()); } exec.execute(wrapper); }