@Override
		public boolean applyTo(Program p, TaskMonitor analysisMonitor) {

			synchronized (this) {
				workerMonitor.removeCancelledListener(this);
				if (commandKilled) {
					notifyAll(); // Allow waiting scheduleWorker method to return
					return false;
				}

				assert (p == program);

				if (analysisMonitor != workerMonitor) {
					if (!workerMonitor.isCancelEnabled()) {
						analysisMonitor.setCancelEnabled(false);
					}
					analysisMonitor.addCancelledListener(this);
				}

				if (!analyzeChanges && ignoreChanges) {
					// we must be a nested worker where the outer worker
					// has requested us to ignore changes
					// set analyzeChanges to true to keep running
					// under current state
					analyzeChanges = true;
				}
			}

			WorkerBlockerTask blockerTask = null;
			boolean wasIgnoringChanges = ignoreChanges;
			try {
				if (!analyzeChanges && !SystemUtilities.isInHeadlessMode()) {
					blockerTask = new WorkerBlockerTask();
				}

				if (!analyzeChanges) {
					// analysis should ignore change events
					doSetIgnoreChanges(true);
				}

				Msg.debug(this, "Invoking analysis worker (" + worker.getWorkerName() + "): " +
					worker.getClass());

				JointTaskMonitor monitor = new JointTaskMonitor(workerMonitor, analysisMonitor);

				returnValue = worker.analysisWorkerCallback(program, workerContext, monitor);
			}
			catch (CancelledException e) {
				// ignore
			}
			catch (Throwable t) {
				exception = new InvocationTargetException(t);
			}
			finally {
				if (!analyzeChanges) {
					// restore event handling state if we had disabled it
					doSetIgnoreChanges(wasIgnoringChanges);
				}

				if (blockerTask != null) {
					blockerTask.terminate();
				}

				if (analysisMonitor != workerMonitor) {
					analysisMonitor.removeCancelledListener(this);
					analysisMonitor.setCancelEnabled(true);
					// prevent cancel from affecting other queued analysis
					analysisMonitor.clearCancelled();
				}

				synchronized (this) {
					notifyAll(); // Allow waiting scheduleWorker method to return
				}
			}

			return true;
		}
<code>AnalysisWorkerCommand</code> facilitates the controlled callback to an AnalysisWorker.
In a Headed environment a modal task dialog will be used to block user input if the
worker was scheduled with analyzeChanges==false
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/analysis/AutoAnalysisManager.java