summaryrefslogtreecommitdiffstats
path: root/libjava/java/util/Timer.java
diff options
context:
space:
mode:
authormark <mark@138bc75d-0d04-0410-961f-82ee72b054a4>2001-11-16 19:00:47 +0000
committermark <mark@138bc75d-0d04-0410-961f-82ee72b054a4>2001-11-16 19:00:47 +0000
commitaff7a0789db08da996414cb7d840c82c70a87d4e (patch)
treef4fc24ee831b743911bbf4560e0a9eff03fbbf4d /libjava/java/util/Timer.java
parent988165f7604154b5605ada1c0039d746adc88e0b (diff)
downloadppe42-gcc-aff7a0789db08da996414cb7d840c82c70a87d4e.tar.gz
ppe42-gcc-aff7a0789db08da996414cb7d840c82c70a87d4e.zip
* java/util/Timer.java (TaskQueue.isStopped): Remove method.
(Scheduler.run): Try to re-schedule task and ignore exception if queue has been stopped. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@47093 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/java/util/Timer.java')
-rw-r--r--libjava/java/util/Timer.java21
1 files changed, 10 insertions, 11 deletions
diff --git a/libjava/java/util/Timer.java b/libjava/java/util/Timer.java
index 2c7197f2dbe..a5e877640fb 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.
+ }
}
}
}
OpenPOWER on IntegriCloud