summaryrefslogtreecommitdiffstats
path: root/src/java/com/jogamp
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2014-01-11 07:39:16 +0100
committerSven Gothel <[email protected]>2014-01-11 07:39:16 +0100
commit6de214a403f4277dbfdff2e9cf974c964f1dcdbb (patch)
treeb4d44941d3c7e54e20c89bc1ed0d9ae897415ee0 /src/java/com/jogamp
parent12fe6a6d8fcce42ccfec9e744e3b834aeaf9608b (diff)
Add TaskBase.flush(Throwsable): To propagate optional reason for flush ; Deprecate flush()
Diffstat (limited to 'src/java/com/jogamp')
-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()}