From 6de214a403f4277dbfdff2e9cf974c964f1dcdbb Mon Sep 17 00:00:00 2001
From: Sven Gothel <sgothel@jausoft.com>
Date: Sat, 11 Jan 2014 07:39:16 +0100
Subject: Add TaskBase.flush(Throwsable): To propagate optional reason for
 flush ; Deprecate flush()

---
 src/java/com/jogamp/common/util/TaskBase.java | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

(limited to 'src/java/com/jogamp/common/util/TaskBase.java')

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()}
-- 
cgit v1.2.3