diff options
author | Sven Gothel <[email protected]> | 2013-07-09 04:25:06 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2013-07-09 04:25:06 +0200 |
commit | 33ff1e3a6e64288028d8c2a8beb350a9f7c89720 (patch) | |
tree | 6b60c8fabf8eff2d54b827926885ab6d68e11031 /src/java/com/jogamp/common/util/FunctionTask.java | |
parent | 3ceb32fb505363ccc02fc4cce1362257ca98a3e5 (diff) |
RunnableTask/FunctionTask run(): Write tExecuted in finally block, removing code redundancy and placing write at end of operation.
Diffstat (limited to 'src/java/com/jogamp/common/util/FunctionTask.java')
-rw-r--r-- | src/java/com/jogamp/common/util/FunctionTask.java | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/java/com/jogamp/common/util/FunctionTask.java b/src/java/com/jogamp/common/util/FunctionTask.java index a131838..01f85b1 100644 --- a/src/java/com/jogamp/common/util/FunctionTask.java +++ b/src/java/com/jogamp/common/util/FunctionTask.java @@ -132,9 +132,7 @@ public class FunctionTask<R,A> extends TaskBase implements Function<R,A> { if(null == syncObject) { try { this.result = runnable.eval(args); - tExecuted = System.currentTimeMillis(); } catch (Throwable t) { - tExecuted = System.currentTimeMillis(); runnableException = t; if(null != exceptionOut) { exceptionOut.println("FunctionTask.run(): "+getExceptionOutIntro()+" exception occured on thread "+Thread.currentThread().getName()+": "+toString()); @@ -144,14 +142,14 @@ public class FunctionTask<R,A> extends TaskBase implements Function<R,A> { if(!catchExceptions) { throw new RuntimeException(runnableException); } + } finally { + tExecuted = System.currentTimeMillis(); } } else { synchronized (syncObject) { try { this.result = runnable.eval(args); - tExecuted = System.currentTimeMillis(); } catch (Throwable t) { - tExecuted = System.currentTimeMillis(); runnableException = t; if(null != exceptionOut) { exceptionOut.println("FunctionTask.run(): "+getExceptionOutIntro()+" exception occured on thread "+Thread.currentThread().getName()+": "+toString()); @@ -162,6 +160,7 @@ public class FunctionTask<R,A> extends TaskBase implements Function<R,A> { throw new RuntimeException(runnableException); } } finally { + tExecuted = System.currentTimeMillis(); syncObject.notifyAll(); } } |