aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/com/jogamp/common/util/TaskBase.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2013-03-18 03:00:45 +0100
committerSven Gothel <[email protected]>2013-03-18 03:00:45 +0100
commitb1eb7ca6b9d7dec7ff62c1f1e8ef0a0545724d2f (patch)
treefd1bb8c41eb1d338bf3185b339a92d583753a39f /src/java/com/jogamp/common/util/TaskBase.java
parent1a4514accc8f61ab7ff5fe8c82d22a5ef356c865 (diff)
Function- RunnableTask: Add PrintStream 'exceptionOut' argument allowing non blocking exceptions to be shown.
Exceptions occuring on non blocking off-thread tasks shall at least be made visible while not allowed to crash the system.
Diffstat (limited to 'src/java/com/jogamp/common/util/TaskBase.java')
-rw-r--r--src/java/com/jogamp/common/util/TaskBase.java10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/java/com/jogamp/common/util/TaskBase.java b/src/java/com/jogamp/common/util/TaskBase.java
index d2a924f..266a5b7 100644
--- a/src/java/com/jogamp/common/util/TaskBase.java
+++ b/src/java/com/jogamp/common/util/TaskBase.java
@@ -28,6 +28,8 @@
package com.jogamp.common.util;
+import java.io.PrintStream;
+
/**
* Helper class to provide a Runnable queue implementation with a Runnable wrapper
* which notifies after execution for the <code>invokeAndWait()</code> semantics.
@@ -35,6 +37,7 @@ package com.jogamp.common.util;
public abstract class TaskBase implements Runnable {
protected final Object syncObject;
protected final boolean catchExceptions;
+ protected final PrintStream exceptionOut;
protected Object attachment;
protected Throwable runnableException;
@@ -42,9 +45,10 @@ public abstract class TaskBase implements Runnable {
protected volatile long tExecuted;
protected volatile boolean isFlushed;
- protected TaskBase(Object syncObject, boolean catchExceptions) {
- this.syncObject = syncObject ;
- this.catchExceptions = catchExceptions ;
+ protected TaskBase(Object syncObject, boolean catchExceptions, PrintStream exceptionOut) {
+ this.syncObject = syncObject;
+ this.catchExceptions = catchExceptions;
+ this.exceptionOut = exceptionOut;
tCreated = System.currentTimeMillis();
tStarted = 0;
tExecuted = 0;