setPriority(6);
while (true) {
current = (Thread) threads.getNext();
while (current == null) {
needThreads = true;
try {
wait();
} catch (Exception e) {}
current = (Thread) threads.getNext();
}
try {
current.setPriority(4);
} catch (Exception e) {
removeThread(current);
continue;
}
try {
wait(timeslice);
} catch (InterruptedException ie) {};
if (current != null) {
try {
current.setPriority(2);
} catch (Exception e) {
removeThread(current);
}
}
}