diff options
author | renanse <[email protected]> | 2013-03-15 11:09:44 -0500 |
---|---|---|
committer | renanse <[email protected]> | 2013-03-15 11:09:44 -0500 |
commit | 11f74fc05dbf5b3ff73980ca966e5faac8fc82ee (patch) | |
tree | ec1a7372cca5905b45166f101c0c9e354647e668 /ardor3d-core/src/main/java | |
parent | 92cde5c9ee985f3021b46848480c9512f55e24de (diff) | |
parent | fc33fb191bc5707824c9e2596afde38a0b5ad3af (diff) |
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'ardor3d-core/src/main/java')
-rw-r--r-- | ardor3d-core/src/main/java/com/ardor3d/util/GameTask.java | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/ardor3d-core/src/main/java/com/ardor3d/util/GameTask.java b/ardor3d-core/src/main/java/com/ardor3d/util/GameTask.java index 99034b4..11bdd37 100644 --- a/ardor3d-core/src/main/java/com/ardor3d/util/GameTask.java +++ b/ardor3d-core/src/main/java/com/ardor3d/util/GameTask.java @@ -24,25 +24,28 @@ import java.util.logging.Logger; * <code>GameTask</code> is used in <code>GameTaskQueue</code> to manage tasks that have yet to be accomplished. */ public class GameTask<V> implements Future<V> { - private static final Logger logger = Logger.getLogger(GameTask.class.getName()); + protected static final Logger logger = Logger.getLogger(GameTask.class.getName()); - private final Callable<V> callable; + protected final Callable<V> callable; - private V _result; - private ExecutionException _exception; - private boolean _cancelled, _finished; - private final ReentrantLock _stateLock = new ReentrantLock(); - private final Condition _finishedCondition = _stateLock.newCondition(); + protected V _result; + protected ExecutionException _exception; + protected boolean _cancelled, _finished; + protected final ReentrantLock _stateLock = new ReentrantLock(); + protected final Condition _finishedCondition = _stateLock.newCondition(); public GameTask(final Callable<V> callable) { this.callable = callable; } + /** + * @param mayInterruptIfRunning + * ignored by this implementation. + */ public boolean cancel(final boolean mayInterruptIfRunning) { - // TODO mayInterruptIfRunning was ignored in previous code, should this param be removed? _stateLock.lock(); try { - if (_result != null) { + if (isDone()) { return false; } _cancelled = true; |