private void taskFinished() {

		// This will release the task dialog.  We passed this latch to the dialog at
		// construction so that does not block until we notify it in the Swing.runLater() below.
		// If we only rely on that notification, then the notification will be blocked when the
		// dialog is waiting in the Swing thread.
		finished.countDown();

		// Do this later on the Swing thread to handle the race condition where the dialog
		// did not exist at the time of this call, but was in the process of being created
		Swing.runLater(() -> {
			if (taskDialog != null) {
				taskDialog.taskProcessed();
			}
		});
	}
Helper class to launch the given task in a background thread, showing a task dialog if
this task takes to long. See {@link TaskLauncher}.
Ghidra/Framework/Docking/src/main/java/ghidra/util/task/TaskRunner.java