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
This commit is contained in:
Mark Wielaard
2001-11-16 19:00:47 +00:00
committed by Mark Wielaard
parent 81bbae61ce
commit 74808218ae
2 changed files with 16 additions and 11 deletions
+10 -11
View File
@@ -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.
}
}
}
}