// Exit when this is set threads = new CircularList(); timeslice = t;
threads.insert(t); t.setPriority(2);
t.setPriority(5); threads.delete(t);
Thread current; setPriority(6); while (shouldRun) { current = (Thread) threads.getNext(); if (current == null) return; current.setPriority(4); try { Thread.sleep(timeslice); } catch (InterruptedException ie) {}; current.setPriority(2); }