mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-20 11:36:16 +07:00
19 lines
460 B
Java
19 lines
460 B
Java
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();
|
|
}
|
|
}
|
|
}
|