Commit f9d44b00 by Tom Tromey Committed by Tom Tromey

re PR libgcj/4859 (java.util.Timer class throw IllegalStateException on cancel())

	Fix for PR libgcj/4859:
	* java/util/Timer.java (TaskQueue.isStopped): New method.
	(Scheduler.run): Don't re-schedule task if queue has been
	stopped.

From-SVN: r46994
parent c19083d8
2001-11-13 Tom Tromey <tromey@redhat.com>
Fix for PR libgcj/4859:
* java/util/Timer.java (TaskQueue.isStopped): New method.
(Scheduler.run): Don't re-schedule task if queue has been
stopped.
2001-11-07 Tom Tromey <tromey@redhat.com> 2001-11-07 Tom Tromey <tromey@redhat.com>
* Makefile.in: Rebuilt. * Makefile.in: Rebuilt.
......
...@@ -285,6 +285,14 @@ public class Timer ...@@ -285,6 +285,14 @@ 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
/** /**
...@@ -337,8 +345,9 @@ public class Timer ...@@ -337,8 +345,9 @@ public class Timer
} }
} }
// Calculate next time and possibly re-enqueue // Calculate next time and possibly re-enqueue.
if (task.scheduled >= 0) // Don't bother re-scheduling if the queue has been stopped.
if (! queue.isStopped () && task.scheduled >= 0)
{ {
if (task.fixed) if (task.fixed)
{ {
......
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