private static boolean waitFor(CyclicBarrier barrier, long timeout, TimeUnit unit)
			throws UnableToSwingException {

		try {
			barrier.await(timeout, unit);
			return true;
		}
		catch (InterruptedException e) {
			// our Swing tasks may be interrupted from the framework
		}
		catch (BrokenBarrierException | TimeoutException e) {
			throw new UnableToSwingException(
				"Timed-out waiting for Swing thread lock in " + timeout + " " + unit);
		}

		// timed-out or was interrupted
		return false;
	}
Calls the given runnable on the Swing thread

<p>This method will throw an exception if the Swing thread is not available within the
given timeout.  This method is useful for preventing deadlocks.

@param r the runnable
@param timeout the timeout value
@param unit the time unit of the timeout value
@throws UnableToSwingException if the timeout was reach waiting for the Swing thread 
@see #runNow(Supplier) if you need to return a value from the Swing thread.
Ghidra/Framework/Utility/src/main/java/ghidra/util/Swing.java