This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Patch: FYI: Fix for PR 4859
- To: Java Patch List <java-patches at gcc dot gnu dot org>
- Subject: Patch: FYI: Fix for PR 4859
- From: Tom Tromey <tromey at redhat dot com>
- Date: 13 Nov 2001 16:31:55 -0700
- Reply-to: tromey at redhat dot com
I'm checking this in.
This fixes PR 4859.
I've already committed this to Classpath.
Tom
Index: ChangeLog
from 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.
Index: java/util/Timer.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/util/Timer.java,v
retrieving revision 1.3
diff -u -r1.3 Timer.java
--- java/util/Timer.java 2001/10/31 00:48:17 1.3
+++ java/util/Timer.java 2001/11/13 23:07:37
@@ -285,6 +285,14 @@
this.notify();
}
+ /**
+ * This method returns <code>true</code> if the queue has been
+ * stopped.
+ */
+ public synchronized boolean isStopped ()
+ {
+ return this.heap == null;
+ }
} // TaskQueue
/**
@@ -337,8 +345,9 @@
}
}
- // Calculate next time and possibly re-enqueue
- if (task.scheduled >= 0)
+ // 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.fixed)
{