diff options
author | Sven Gothel <[email protected]> | 2014-01-11 07:39:16 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2014-01-11 07:39:16 +0100 |
commit | 6de214a403f4277dbfdff2e9cf974c964f1dcdbb (patch) | |
tree | b4d44941d3c7e54e20c89bc1ed0d9ae897415ee0 /src/java | |
parent | 12fe6a6d8fcce42ccfec9e744e3b834aeaf9608b (diff) |
Add TaskBase.flush(Throwsable): To propagate optional reason for flush ; Deprecate flush()
Diffstat (limited to 'src/java')
-rw-r--r-- | src/java/com/jogamp/common/util/TaskBase.java | 11 |
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()} |