else {
shell(this);
}
}
public void shutdown() throws InterruptedException {
<BUG>scheduler.queueLock.lock();
</BUG>
try {
<BUG>while (!scheduler.queue.isEmpty()) {
scheduler.queueEmpty.await();
}</BUG>
scheduler.doRun = false;

else {
shell(this);
}
}
public void shutdown() throws InterruptedException {
scheduler.stateLock.lock();
try {
while (!scheduler.queue.isEmpty() || scheduler.freeAnnotators.size() != scheduler.backends.size()) {
scheduler.shouldShutdown.await(5, TimeUnit.SECONDS);
}
scheduler.doRun = false;
