diff options
author | Sven Gothel <[email protected]> | 2013-03-18 04:02:46 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2013-03-18 04:02:46 +0100 |
commit | 192224fc3c38521f38eb3bc51bebb16b628e4cdb (patch) | |
tree | 45eb572fed6672e5eacc9531b48aca226e579c08 /src/java/com/jogamp/common/util/RunnableTask.java | |
parent | b1eb7ca6b9d7dec7ff62c1f1e8ef0a0545724d2f (diff) |
Function- RunnableTask: Clear runnableException @ start for re-entry; Fix tExecuted (@ exception); Add debug property 'jogamp.debug.TaskBase.TraceSource', to dump ctor stack trace @ exception.
Diffstat (limited to 'src/java/com/jogamp/common/util/RunnableTask.java')
-rw-r--r-- | src/java/com/jogamp/common/util/RunnableTask.java | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/java/com/jogamp/common/util/RunnableTask.java b/src/java/com/jogamp/common/util/RunnableTask.java index ee484e1..ce4688d 100644 --- a/src/java/com/jogamp/common/util/RunnableTask.java +++ b/src/java/com/jogamp/common/util/RunnableTask.java @@ -88,35 +88,41 @@ public class RunnableTask extends TaskBase { @Override public final void run() { + runnableException = null; tStarted = System.currentTimeMillis(); if(null == syncObject) { try { runnable.run(); + tExecuted = System.currentTimeMillis(); } catch (Throwable t) { + tExecuted = System.currentTimeMillis(); runnableException = t; if(null != exceptionOut) { - t.printStackTrace(exceptionOut); + exceptionOut.println("RunnableTask.run(): "+getExceptionOutIntro()+" exception occured on thread "+Thread.currentThread().getName()+": "+toString()); + printSourceTrace(); + runnableException.printStackTrace(exceptionOut); } if(!catchExceptions) { throw new RuntimeException(runnableException); } - } finally { - tExecuted = System.currentTimeMillis(); } } else { synchronized (syncObject) { try { runnable.run(); + tExecuted = System.currentTimeMillis(); } catch (Throwable t) { + tExecuted = System.currentTimeMillis(); runnableException = t; if(null != exceptionOut) { + exceptionOut.println("RunnableTask.run(): "+getExceptionOutIntro()+" exception occured on thread "+Thread.currentThread().getName()+": "+toString()); + printSourceTrace(); t.printStackTrace(exceptionOut); } if(!catchExceptions) { throw new RuntimeException(runnableException); } } finally { - tExecuted = System.currentTimeMillis(); syncObject.notifyAll(); } } |