blob: 4d369fe54b9b6aeb93a342b033a25d74bfee08b2 [file]
class AsynchronousImageLoader extends Thread {
interface Stack {
boolean isEmpty();
Object pop();
}
private void threadBody(Stack _tasks) throws InterruptedException {
while (true) {
final Runnable task;
synchronized (this) {
while (_tasks.isEmpty())
wait();
task = (Runnable) _tasks.pop();
}
task.run();
}
}
}