public synchronized void cancelQueuedTasks() {
		while (!queue.isEmpty()) {
			BackgroundCommand<Program> cmd = queue.getFirst();
			if (cmd instanceof AnalysisWorkerCommand) {
				AnalysisWorkerCommand workerCmd = (AnalysisWorkerCommand) cmd;
				if (!workerCmd.canCancel()) {
					return;
				}
			}
			cmd = queue.removeFirst();
			cmd.dispose();
		}
	}
Tell all the tasks that they are canceled.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/analysis/AutoAnalysisManager.java