@Override
	public void run(TaskMonitor monitor) {
		if (plugin.isTaskInProgress()) {
			return;
		}

		try {
			DiffController dc = null;
			plugin.setTaskInProgress(true);
			monitor.setIndeterminate(true);
			monitor.setMessage("Checking Program Differences");
			try {
				dc = new DiffController(program1, program2, limitedAddressSet, this.diffFilter,
					this.applyFilter);
				AddressSetView filteredDifferences = dc.getFilteredDifferences(monitor);
				boolean noFilteredDifferencesFound = filteredDifferences.isEmpty();
				plugin.setDiffController(dc);
				dc.differencesChanged();
				dc.setLocation(plugin.getCurrentAddress());
				monitor.setMessage("Done");
				Runnable r = () -> displayDifferencesMessageIfNecessary(noFilteredDifferencesFound);
				SwingUtilities.invokeLater(r);
			}
			catch (DomainObjectException e) {
				Throwable cause = e.getCause();
				if (cause instanceof ClosedException) {
					// this can happen if you close the tool while this task is calculating diffs
				}
				else {
					throw e;
				}
			}
			catch (ProgramConflictException e) {
				showErrorMessage(e.getMessage());
				return;
			}
			catch (CancelledException e) {
				plugin.setDiffController(dc);
			}
		}
		finally {
			completed();
		}
	}
This is the method TaskMonitor called to do the work.

@param monitor The TaskMonitor that will monitor the executing Task.  Will be null if
		  this task declared that it does not use a TaskMonitor
Ghidra/Features/ProgramDiff/src/main/java/ghidra/app/plugin/core/diff/CreateDiffTask.java