2003/12/16 22:35:20
[org.ibex.core.git] / src / org / xwt / Scheduler.java
index 8a5cd32..3dcc7f5 100644 (file)
@@ -12,7 +12,13 @@ public class Scheduler {
 
     private static Scheduler singleton;
     public static interface Task { public abstract void perform() throws Exception; }
+
+    /** adds a task to the back of the queue */
     public static void add(Task t) { singleton.runnable.append(t); }
+
+    /** adds a task to the front of the queue (guaranteed to run next) */
+    public static void addAtFront(Task t) { singleton.runnable.prepend(t); }
+
     public static void init() { if (singleton == null) (singleton = Platform.getScheduler()).run(); }
 
     // API which must be supported by subclasses /////////////////////////////////////