diff options
author | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-11-13 23:09:23 +0000 |
---|---|---|
committer | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-11-13 23:09:23 +0000 |
commit | 2d32a9b6a4342b47e9133f75d5c5b23ff42ce36d (patch) | |
tree | e9b663583e713a1ac78ca30e1a59b238265e40fd /libjava/java | |
parent | 67f25eeb3d5ebb1832d9328beed72482627458f0 (diff) | |
download | ppe42-gcc-2d32a9b6a4342b47e9133f75d5c5b23ff42ce36d.tar.gz ppe42-gcc-2d32a9b6a4342b47e9133f75d5c5b23ff42ce36d.zip |
Fix for PR libgcj/4859:
* java/util/Timer.java (TaskQueue.isStopped): New method.
(Scheduler.run): Don't re-schedule task if queue has been
stopped.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@46994 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/java')
-rw-r--r-- | libjava/java/util/Timer.java | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/libjava/java/util/Timer.java b/libjava/java/util/Timer.java index 32c0bea3b3f..2c7197f2dbe 100644 --- a/libjava/java/util/Timer.java +++ b/libjava/java/util/Timer.java @@ -285,6 +285,14 @@ public class Timer this.notify(); } + /** + * This method returns <code>true</code> if the queue has been + * stopped. + */ + public synchronized boolean isStopped () + { + return this.heap == null; + } } // TaskQueue /** @@ -337,8 +345,9 @@ public class Timer } } - // Calculate next time and possibly re-enqueue - if (task.scheduled >= 0) + // Calculate next time and possibly re-enqueue. + // Don't bother re-scheduling if the queue has been stopped. + if (! queue.isStopped () && task.scheduled >= 0) { if (task.fixed) { |