private void doTerminated(final long timeNowMs, final List<TaskProgress> taskProgressList,
                              final List<TaskContextImpl> itemsToKill) {
        LOGGER.trace(() -> LogUtil.message("doTerminated() - itemsToKill.size() {}", itemsToKill.size()));

        for (final TaskContextImpl taskContext : itemsToKill) {
            // Try and terminate the task.
            if (!taskContext.isTerminated()) {
                LOGGER.trace(() -> LogUtil.message("terminating task {}", taskContext.getTaskId()));
                taskContext.terminate();
            }
            final TaskProgress taskProgress = buildTaskProgress(timeNowMs, taskContext);
            taskProgressList.add(taskProgress);
        }
    }
Tells tasks to terminate and waits for all tasks to terminate before
cleaning up the executors.
stroom-task/stroom-task-impl/src/main/java/stroom/task/impl/TaskManagerImpl.java