1 /*******************************************************************************
2 * Copyright (c) 2000, 2011 IBM Corporation and others.
4 * This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License 2.0
6 * which accompanies this distribution, and is available at
7 * https://www.eclipse.org/legal/epl-2.0/
9 * SPDX-License-Identifier: EPL-2.0
12 * IBM Corporation - initial API and implementation
13 *******************************************************************************/
14 package org.eclipse.swt.widgets;
18 * Instances of this class are used to ensure that an
19 * application cannot interfere with the locking mechanism
20 * used to implement asynchronous and synchronous communication
21 * between widgets and background threads.
29 RunnableLock (Runnable runnable) {
30 this.runnable = runnable;
34 return runnable == null || throwable != null;
37 void run (Display display) {
38 if (runnable != null) {
41 } catch (RuntimeException exception) {
42 display.getRuntimeExceptionHandler ().accept (exception);
43 } catch (Error error) {
44 display.getErrorHandler ().accept (error);