From 433e3914324b90c910b018bb7d9d80e814c67123 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Fri, 5 Jul 2013 22:48:12 +0200 Subject: Fix SWTEDTUtil regression caused by dec4b02fe4b93028c85de6a56b6af79601042d6e, ensuring EDT is running for reused Display instances. Refine EDTUtil semantics of: - reset() - waitUntilStopped() AWTEDTUtil/SWTEDTUtil: Properly signal !running when shutdown SWTEDTUtil: Take SWT isDisposed() into account. --- src/newt/classes/com/jogamp/newt/util/EDTUtil.java | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'src/newt/classes/com') diff --git a/src/newt/classes/com/jogamp/newt/util/EDTUtil.java b/src/newt/classes/com/jogamp/newt/util/EDTUtil.java index 0df815609..75848785c 100644 --- a/src/newt/classes/com/jogamp/newt/util/EDTUtil.java +++ b/src/newt/classes/com/jogamp/newt/util/EDTUtil.java @@ -65,14 +65,18 @@ public interface EDTUtil { public void setPollPeriod(long ms); /** - * Create a new EDT. One should invoke reset()
- * after invokeStop(..) in case another start via invoke(..) - * is expected. + * Resets the stopped EDT, i.e. prepares it for a restart via + * the next invoke(..) call. + *

+ * One must stop the EDT first via {@link #invokeStop(boolean, Runnable)} + * and wait until it's stopped via {@link #waitUntilStopped()}. + *

* * @see #invoke(boolean, java.lang.Runnable) * @see #invokeStop(boolean, java.lang.Runnable) + * @throws IllegalStateException if stop has not been issued, or EDT is still running (caller thread not being EDT or NEDT). */ - public void reset(); + public void reset() throws IllegalStateException; /** * Returns true if the current thread is the event dispatch thread (EDT). @@ -150,6 +154,9 @@ public interface EDTUtil { /** * Wait until EDT task is stopped.
* No stop action is performed, {@link #invokeStop(boolean, java.lang.Runnable)} should be used before. + *

+ * If caller thread is EDT or NEDT, this call will not block. + *

*/ public void waitUntilStopped(); } -- cgit v1.2.3