This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Patch: FYI: Fix for PR 4859


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)
 		{


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]