From 74808218aed768218a0d7d9876be8af3ab11acfa Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Fri, 16 Nov 2001 19:00:47 +0000 Subject: 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 --- libjava/java/util/Timer.java | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'libjava/java/util') 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 true 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. + } } } } -- cgit v1.1