public void analyzeChanges(Program program) {

		AutoAnalysisManager mgr = AutoAnalysisManager.getAnalysisManager(program);

		// analysis will start immediately in background if GUI analysis tool exists
		// and script is not running as analysis worker in background

		PluginTool analysisTool = mgr.getAnalysisTool();
		if (analysisTool == null || analysisTool.threadIsBackgroundTaskThread()) {
			mgr.startAnalysis(monitor, true); // yields to analysis
		}
		else {
			mgr.waitForAnalysis(null, monitor); // waits for all analaysis to complete
		}
	}
Starts auto-analysis if not started and waits for pending analysis to complete.
Only pending analysis on program changes is performed, including changes resulting
from any analysis activity.  This method will block until analysis completes.
NOTE: The auto-analysis manager will only detect program changes once it has been
instantiated for a program (i.e, AutoAnalysisManager.getAnalysisManager(program) ).
This is automatically done for the initial currentProgram, however, if a script is
opening/instantiating its own programs it may be necessary to do this prior to
making changes to the program.
@param program the program to analyze
Ghidra/Features/Base/src/main/java/ghidra/program/flatapi/FlatProgramAPI.java