void waitForTaskCompletion() {
		synchronized (this) {
			if (dobj == null) {
				return;
			}
			if (taskDialog == null) {
				taskDialog = new MyTaskDialog();
			}
			else {
				try {
					// dialog already displayed - wait for releaseLock to occur
					wait();
				}
				catch (InterruptedException e) {
					// ignore
				}
				return;
			}
		}

		// show dialog without synchronization
		MyTaskDialog dialog = taskDialog;
		if (dialog != null) {
			SystemUtilities.runSwingNow(() -> dialog.show(0));
		}
	}
Display a modal task dialog associated with this locking task.
This method will not return until the task has completed and the
lock has been released.
Ghidra/Framework/Project/src/main/java/ghidra/framework/data/LockingTaskMonitor.java