aboutsummaryrefslogtreecommitdiff
path: root/libjava
diff options
context:
space:
mode:
authorMark Wielaard <mark@klomp.org>2001-11-16 19:00:47 +0000
committerMark Wielaard <mark@gcc.gnu.org>2001-11-16 19:00:47 +0000
commit74808218aed768218a0d7d9876be8af3ab11acfa (patch)
treef4fc24ee831b743911bbf4560e0a9eff03fbbf4d /libjava
parent81bbae61cec567c5528f78ed5afb53289a9fc63a (diff)
downloadgcc-74808218aed768218a0d7d9876be8af3ab11acfa.zip
gcc-74808218aed768218a0d7d9876be8af3ab11acfa.tar.gz
gcc-74808218aed768218a0d7d9876be8af3ab11acfa.tar.bz2
Timer.java (TaskQueue.isStopped): Remove method.
* java/util/Timer.java (TaskQueue.isStopped): Remove method. (Scheduler.run): Try to re-schedule task and ignore exception if queue has been stopped. From-SVN: r47093
Diffstat (limited to 'libjava')
-rw-r--r--libjava/ChangeLog6
-rw-r--r--libjava/java/util/Timer.java21
2 files changed, 16 insertions, 11 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog
index d6c3dac..02fa0b3 100644
--- a/libjava/ChangeLog
+++ b/libjava/ChangeLog
@@ -1,3 +1,9 @@
+2001-11-16 Mark Wielaard <mark@klomp.org>
+
+ * java/util/Timer.java (TaskQueue.isStopped): Remove method.
+ (Scheduler.run): Try to re-schedule task and ignore exception if
+ queue has been stopped.
+
2001-11-15 Tom Tromey <tromey@redhat.com>
* verify.cc (type::compatible): Use _Jv_IsAssignableFrom.
diff --git a/libjava/java/util/Timer.java b/libjava/java/util/Timer.java
index 2c7197f..a5e8776 100644
--- a/libjava/java/util/Timer.java
+++ b/libjava/java/util/Timer.java
@@ -285,14 +285,6 @@ 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
/**
@@ -346,8 +338,7 @@ public class Timer
}
// 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.scheduled >= 0)
{
if (task.fixed)
{
@@ -357,7 +348,15 @@ public class Timer
{
task.scheduled = task.period + System.currentTimeMillis();
}
- queue.enqueue(task);
+
+ try
+ {
+ queue.enqueue(task);
+ }
+ catch (IllegalStateException ise)
+ {
+ // Ignore. Apparently the Timer queue has been stopped.
+ }
}
}
}