X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Forg%2Fxwt%2FScheduler.java;fp=src%2Forg%2Fxwt%2FScheduler.java;h=0000000000000000000000000000000000000000;hb=3591b88b94a6bb378af3d4abe6eb5233ce583104;hp=9e939a3d87f7a55c77971268342d403004b4278e;hpb=de378041d5ca2aca1a2b5a31ef15ae90a86c977f;p=org.ibex.core.git diff --git a/src/org/xwt/Scheduler.java b/src/org/xwt/Scheduler.java deleted file mode 100644 index 9e939a3..0000000 --- a/src/org/xwt/Scheduler.java +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright 2004 Adam Megacz, see the COPYING file for licensing [GPL] -package org.xwt; - -import java.util.*; -import org.xwt.js.*; -import org.xwt.util.*; - -/** Implements cooperative multitasking */ -public class Scheduler { - - // Public API Exposed to org.xwt ///////////////////////////////////////////////// - - private static Scheduler singleton; - public static interface Task { public abstract void perform() throws Exception; } - public static void add(Task t) { singleton.runnable.append(t); } - public static void init() { if (singleton == null) (singleton = Platform.getScheduler()).run(); } - - private static Task current = null; - - private static volatile boolean rendering = false; - private static volatile boolean again = false; - - /** synchronizd so that we can safely call it from an event-delivery thread, in-context */ - public static void renderAll() { - if (rendering) { again = true; return; } - synchronized(Scheduler.class) { - try { - rendering = true; - do { - // FEATURE: this could be cleaner - again = false; - for(int i=0; i