Commit 74808218 by Mark Wielaard Committed by Mark Wielaard

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
parent 81bbae61
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> 2001-11-15 Tom Tromey <tromey@redhat.com>
* verify.cc (type::compatible): Use _Jv_IsAssignableFrom. * verify.cc (type::compatible): Use _Jv_IsAssignableFrom.
......
...@@ -285,14 +285,6 @@ public class Timer ...@@ -285,14 +285,6 @@ public class Timer
this.notify(); this.notify();
} }
/**
* This method returns <code>true</code> if the queue has been
* stopped.
*/
public synchronized boolean isStopped ()
{
return this.heap == null;
}
} // TaskQueue } // TaskQueue
/** /**
...@@ -346,8 +338,7 @@ public class Timer ...@@ -346,8 +338,7 @@ public class Timer
} }
// Calculate next time and possibly re-enqueue. // Calculate next time and possibly re-enqueue.
// Don't bother re-scheduling if the queue has been stopped. if (task.scheduled >= 0)
if (! queue.isStopped () && task.scheduled >= 0)
{ {
if (task.fixed) if (task.fixed)
{ {
...@@ -357,7 +348,15 @@ public class Timer ...@@ -357,7 +348,15 @@ public class Timer
{ {
task.scheduled = task.period + System.currentTimeMillis(); task.scheduled = task.period + System.currentTimeMillis();
} }
queue.enqueue(task);
try
{
queue.enqueue(task);
}
catch (IllegalStateException ise)
{
// Ignore. Apparently the Timer queue has been stopped.
}
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment