Timer.java (TaskQueue.isStopped): Remove method.
authorMark Wielaard <mark@klomp.org>
Fri, 16 Nov 2001 19:00:47 +0000 (19:00 +0000)
committerMark Wielaard <mark@gcc.gnu.org>
Fri, 16 Nov 2001 19:00:47 +0000 (19:00 +0000)
* 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

libjava/ChangeLog
libjava/java/util/Timer.java

index d6c3dac9a73ebd89d1ec221e664858c4874df10f..02fa0b36da718d89f4facc97ebfc596b6f7bb7a8 100644 (file)
@@ -1,3 +1,9 @@
+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>
 
        * verify.cc (type::compatible): Use _Jv_IsAssignableFrom.
index 2c7197f2dbec202277413b6fc3997391dc0cfa03..a5e877640fb713b0f7c3e9c7d3607874308f08d8 100644 (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.
+               }
            }
        }
     }