aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/com/jogamp/common/util/RunnableTask.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/java/com/jogamp/common/util/RunnableTask.java')
-rw-r--r--src/java/com/jogamp/common/util/RunnableTask.java14
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();
}
}