X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Forg%2Fxwt%2FScheduler.java;fp=src%2Forg%2Fxwt%2FScheduler.java;h=3dcc7f54701913e02518db7c830a93565aac1e44;hb=78c49c04f5b4718f99b1283a9b685e0785629928;hp=8a5cd3226d9f5d286abf80d23580d78e1276be69;hpb=2c0ae10e1f1d99d1661b798e479d2d4e68f523d2;p=org.ibex.core.git diff --git a/src/org/xwt/Scheduler.java b/src/org/xwt/Scheduler.java index 8a5cd32..3dcc7f5 100644 --- a/src/org/xwt/Scheduler.java +++ b/src/org/xwt/Scheduler.java @@ -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 /////////////////////////////////////