private void flush(IncrementalUpdatingAccumulator accumulator, TaskMonitor monitor) {

		//
		// Acquire the update manager lock so that it doesn't send out any events while we are
		// giving it the data we just finished loading.
		//
		synchronized (updateManager.getSynchronizingLock()) {

			if (hasBeenCancelled(monitor)) {
				// Check for cancelled inside of this lock.  This guarantees that no events will be
				// sent out before we can add our listener
				return;
			}

			// push the data to the update manager...
			accumulator.flushData();

			//
			// ...Add a listener to know when we can tell our listeners that loading is finished.
			//
			// (Add the listener later so that we don't get notified of any pending events from
			// the update manager that may have already been posted by the time we have
			// acquired the lock above.)
			//
			// Also, we are guaranteed that the flush() call will not call to the Swing thread
			// before we add our listener due to the fact that we currently hold a lock on the
			// updateManager, which is required to notify the listeners.  The basic sequence is:
			//
			// -Flush starts a job thread (or uses the running one)
			// -We have the update manager's lock, so it blocks on jobDone() if that happens before
			//     this code can return
			// -We push the invokeLater()
			// -We release the lock
			// -A block on jobDone() can now complete as we release the lock
			// -jobDone() will notify listeners in an invokeLater(), which puts it behind ours
			//			
			Swing.runLater(() -> updateManager.addThreadedTableListener(IncrementalLoadJob.this));
		}

		waitForThreadedTableUpdateManagerToFinish();
	}
This method tracks cancelled from the given monitor and from any cancelled exceptions that
happen during loading.  When loading, the client may trigger a cancelled exception even
though the monitor has not been cancelled.
@param monitor the task monitor
@return true if cancelled
Ghidra/Framework/Docking/src/main/java/docking/widgets/table/threaded/IncrementalLoadJob.java