private static <K> boolean canSquashException(Throwable t, boolean isCancelled) {
		//
		// We have a policy of ignoring DB closed exceptions when a task has already
		// been cancelled, as this can happen when shutting down Ghidra.
		//
		if (!isCancelled) {
			return false;
		}

		if (t instanceof CancelledException) {
			return true;
		}

		if (t instanceof ClosedException) {
			return true;
		}

		// sometimes ClosedExceptions are wrapped in RuntimeExceptions
		Throwable cause = t.getCause();
		if (cause != null) {
			return canSquashException(cause, isCancelled);
		}

		return false;
	}
Constructs a new Worker with the given name.

@param queue the queue into which jobs will be place (e.g. PriorityBlockingQueue or
             LinkedBlockingQueue).
@param isPersistentThread if true, the worker thread will stay around when idle; false means
            that the thread will go away if not needed. Should be true for high frequency
            usage.
@param name the name of this worker. The thread that executes the jobs will have this name.
@param shareThreadPool true signals to use the given name to find/create a thread pool that
            can be shared throughout the system.
@param monitor the task monitor that allows for cancelling of jobs.
Ghidra/Framework/Generic/src/main/java/ghidra/util/worker/AbstractWorker.java