30package com.jogamp.opengl.test.junit.util;
32import org.eclipse.swt.widgets.Display;
34import com.jogamp.newt.util.EDTUtil;
39 final boolean blocking;
41 volatile Exception exo =
null;
44 this.display = display;
45 this.blocking = blocking;
46 this.sleepMS = sleepMS;
49 final Runnable waitAction0 =
new Runnable() {
52 if( !display.readAndDispatch() ) {
54 Thread.sleep(sleepMS);
55 }
catch (
final InterruptedException e) { }
63 display.syncExec( waitAction0 );
65 display.asyncExec( waitAction0 );
67 }
catch (
final Exception ex) {
73 final Exception r = exo;
84 final boolean blocking;
89 this.display = display;
90 this.blocking = blocking;
91 this.sleepMS = sleepMS;
94 final Runnable waitAction0 =
new Runnable() {
97 if( !display.readAndDispatch() ) {
99 Thread.sleep(sleepMS);
100 }
catch (
final InterruptedException e) { }
106 edt.
invoke(blocking, waitAction0);
WaitAction2(final EDTUtil edt, final Display display, final boolean blocking, final long sleepMS)
WaitAction(final Display display, final boolean blocking, final long sleepMS)
Exception getException(final boolean clear)
EDT stands for Event Dispatch Thread.
boolean invoke(boolean wait, Runnable task)
Appends task to the EDT task queue if current thread is not EDT, otherwise execute task immediately.