Bug 223188 [ErrorHandling] Crash of ModalContext thread freezes UI thread
bundles/org.eclipse.jface/src/org/eclipse/jface/operation/ModalContext.java
* <code>run</code> method is executed in a separate thread, depending on the
 * value of the passed fork argument. If the runnable is executed in a separate
 * thread then the current thread either waits until the new thread ends or, if
 * the current thread is the UI thread, it polls the SWT event queue and
 * dispatches each event.
 * <p>
 * This class is not intended to be subclassed.
 * </p>
 */
public class ModalContext {
	/**
	 * Indicated whether ModalContext is in debug mode; <code>false</code> by
	 * default.
	 */
	private static boolean debug = false;
	/**
	 * The number of nested modal runs, or 0 if not inside a modal run. This is
	 * global state.
	 */
	private static int modalLevel = 0;
	/**
	 * Indicates whether operations should be run in a separate thread. Defaults
	 * to true. For internal debugging use, set to false to run operations in
	 * the calling thread.
	 */
	private static boolean runInSeparateThread = true;
	/**
	 * Thread which runs the modal context.
	 */
	private static class ModalContextThread extends Thread {