public boolean threadIsBackgroundTaskThread() {
		ThreadGroup taskGroup = taskMgr.getTaskThreadGroup();
		ThreadGroup group = Thread.currentThread().getThreadGroup();
		while (group != null && group != taskGroup) {
			group = group.getParent();
		}
		return group == taskGroup;
	}
@return true if the current thread group or its ancestors is
a member of this tools background task thread group, else false
Ghidra/Framework/Project/src/main/java/ghidra/framework/plugintool/PluginTool.java