summaryrefslogtreecommitdiffstats
path: root/src/java/com/jogamp/common/util
diff options
context:
space:
mode:
Diffstat (limited to 'src/java/com/jogamp/common/util')
-rw-r--r--src/java/com/jogamp/common/util/TaskBase.java11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/java/com/jogamp/common/util/TaskBase.java b/src/java/com/jogamp/common/util/TaskBase.java
index e76893d..f305bb1 100644
--- a/src/java/com/jogamp/common/util/TaskBase.java
+++ b/src/java/com/jogamp/common/util/TaskBase.java
@@ -108,17 +108,26 @@ public abstract class TaskBase implements Runnable {
* The executor which might have been blocked until notified
* will be unblocked and the task removed from the queue.
*
+ * @param t optional Throwable to be assigned for later {@link #getThrowable()} query in case of an error.
+ *
* @see #isFlushed()
* @see #isInQueue()
*/
- public final void flush() {
+ public final void flush(Throwable t) {
if(!isExecuted() && hasWaiter()) {
+ runnableException = t;
synchronized (syncObject) {
isFlushed = true;
syncObject.notifyAll();
}
}
}
+ /**
+ * @deprecated Use {@link #flush(Throwable)}.
+ */
+ public final void flush() {
+ this.flush(null);
+ }
/**
* @return !{@link #isExecuted()} && !{@link #isFlushed()}