diff options
Diffstat (limited to 'src/java/com/jogamp/common/util/RunnableTask.java')
-rw-r--r-- | src/java/com/jogamp/common/util/RunnableTask.java | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/src/java/com/jogamp/common/util/RunnableTask.java b/src/java/com/jogamp/common/util/RunnableTask.java index 57809b9..2689de1 100644 --- a/src/java/com/jogamp/common/util/RunnableTask.java +++ b/src/java/com/jogamp/common/util/RunnableTask.java @@ -40,18 +40,16 @@ public class RunnableTask extends TaskBase { protected final Runnable runnable; /** - * @deprecated Simply invoke {@link Runnable#run()} - */ - public static void invoke(final boolean waitUntilDone, final Runnable runnable) { - runnable.run(); - } - - /** - * @deprecated Use {@link #invokeOnNewThread(ThreadGroup, String, boolean, Runnable)} + * Invokes <code>runnable</code> on the current {@link Thread}. + * @param runnable the {@link Runnable} to execute on the current thread. + * The runnable <b>must exit</b>, i.e. not loop forever. + * @return the newly created and invoked {@link RunnableTask} + * @since 2.4.0 */ - public static Thread invokeOnNewThread(final ThreadGroup tg, final boolean waitUntilDone, final Runnable runnable, final String threadName) { - final RunnableTask rt = invokeOnNewThread(tg, threadName, waitUntilDone, runnable); - return rt.getExecutionThread(); + public static RunnableTask invokeOnCurrentThread(final Runnable runnable) { + final RunnableTask rt = new RunnableTask( runnable, null, false, null ); + rt.run(); + return rt; } /** |