public synchronized <T extends DomainObject> void scheduleFollowOnCommand(
			BackgroundCommand<T> cmd, T obj) {

		if (isProcessingDomainObject(obj)) {

			PriorityQueue<BackgroundCommand<?>> queue = queuedCommandsMap.get(obj);
			if (queue == null) {
				queue = new PriorityQueue<>();
				queuedCommandsMap.put(obj, queue);
			}

			// no need to add repeated entries to the queue
			if (!mergeMergeableBackgroundCommands(cmd, queue)) {
				queue.add(cmd, 1);
			}
		}
		else {
			executeCommand(cmd, obj);
		}
	}
Schedule the given background command when the current command completes.

@param cmd background command to be scheduled
@param obj domain object that supports undo/redo
Ghidra/Framework/Project/src/main/java/ghidra/framework/plugintool/mgr/ToolTaskManager.java