diff options
author | Sven Gothel <[email protected]> | 2015-10-15 14:03:53 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2015-10-15 14:03:53 +0200 |
commit | acd52a1936090eee11b3220f5c75ee37763773c7 (patch) | |
tree | 239c23ecc917650bd59d9aaddb1b76b9a9d01197 /src/java/com/jogamp/common/util/FunctionTask.java | |
parent | f829ccd1696e3b4016f11319f7b6148a8a0a2c78 (diff) |
Remove deprectated classes and methods
Diffstat (limited to 'src/java/com/jogamp/common/util/FunctionTask.java')
-rw-r--r-- | src/java/com/jogamp/common/util/FunctionTask.java | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/java/com/jogamp/common/util/FunctionTask.java b/src/java/com/jogamp/common/util/FunctionTask.java index 630ae2f..9eb1ca5 100644 --- a/src/java/com/jogamp/common/util/FunctionTask.java +++ b/src/java/com/jogamp/common/util/FunctionTask.java @@ -42,10 +42,21 @@ public class FunctionTask<R,A> extends TaskBase implements Function<R,A> { protected A[] args; /** - * @deprecated Simply invoke {@link Function#eval(Object...)} + * Invokes <code>func</code> on the current {@link Thread}. + * <p> + * The result can be retrieved via {@link FunctionTask#getResult()}, + * using the returned instance. + * </p> + * @param func the {@link Function} to execute. + * @param args the {@link Function} arguments + * @return the newly created and invoked {@link FunctionTask} + * @since 2.4.0 */ - public static <U,V> U invoke(final boolean waitUntilDone, final Function<U,V> func, final V... args) { - return func.eval(args); + public static <U,V> FunctionTask<U,V> invokeOnCurrentThread(final Function<U,V> func, final V... args) { + final FunctionTask<U,V> rt = new FunctionTask<U,V>( func, null, false, null); + rt.args = args; + rt.run(); + return rt; } /** |