summaryrefslogtreecommitdiffstats
path: root/src/newt/classes/com
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2013-07-05 22:48:12 +0200
committerSven Gothel <[email protected]>2013-07-05 22:48:12 +0200
commit433e3914324b90c910b018bb7d9d80e814c67123 (patch)
tree5b7e026db862f755a6cf2a67a3ae7abe702256a2 /src/newt/classes/com
parentdec4b02fe4b93028c85de6a56b6af79601042d6e (diff)
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.
Diffstat (limited to 'src/newt/classes/com')
-rw-r--r--src/newt/classes/com/jogamp/newt/util/EDTUtil.java15
1 files changed, 11 insertions, 4 deletions
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 <code>reset()</code><br>
- * after <code>invokeStop(..)</code> in case another start via <code>invoke(..)</code>
- * is expected.
+ * Resets the stopped EDT, i.e. prepares it for a restart via
+ * the next <code>invoke(..)</code> call.
+ * <p>
+ * One must stop the EDT first via {@link #invokeStop(boolean, Runnable)}
+ * and wait until it's stopped via {@link #waitUntilStopped()}.
+ * </p>
*
* @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.<br>
* No <code>stop</code> action is performed, {@link #invokeStop(boolean, java.lang.Runnable)} should be used before.
+ * <p>
+ * If caller thread is EDT or NEDT, this call will not block.
+ * </p>
*/
public void waitUntilStopped();
}