aboutsummaryrefslogtreecommitdiff
path: root/libjava
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2001-11-13 23:09:23 +0000
committerTom Tromey <tromey@gcc.gnu.org>2001-11-13 23:09:23 +0000
commitf9d44b00b686b9973139863c7d6472c2b7a11eb3 (patch)
treee9b663583e713a1ac78ca30e1a59b238265e40fd /libjava
parentc19083d85209756915bfc19d00e38d39dbb73039 (diff)
downloadgcc-f9d44b00b686b9973139863c7d6472c2b7a11eb3.zip
gcc-f9d44b00b686b9973139863c7d6472c2b7a11eb3.tar.gz
gcc-f9d44b00b686b9973139863c7d6472c2b7a11eb3.tar.bz2
re PR libgcj/4859 (java.util.Timer class throw IllegalStateException on cancel())
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. From-SVN: r46994
Diffstat (limited to 'libjava')
-rw-r--r--libjava/ChangeLog7
-rw-r--r--libjava/java/util/Timer.java13
2 files changed, 18 insertions, 2 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog
index 9dfcd7b..fd3e7ba 100644
--- a/libjava/ChangeLog
+++ b/libjava/ChangeLog
@@ -1,3 +1,10 @@
+2001-11-13 Tom Tromey <tromey@redhat.com>
+
+ 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.
+
2001-11-07 Tom Tromey <tromey@redhat.com>
* Makefile.in: Rebuilt.
diff --git a/libjava/java/util/Timer.java b/libjava/java/util/Timer.java
index 32c0bea..2c7197f 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)
{