Java源码示例:org.checkerframework.checker.lock.qual.GuardedBy
示例1@GuardedBy("lock")
private boolean waitForQueue() {
long timeout = TASK_WAIT_NANOS;
while (queue.isEmpty()) {
if (timeout <= 0) {
return false;
}
try {
timeout = notEmpty.awaitNanos(timeout);
} catch (InterruptedException e) {
// The executor is probably shutting down so log as debug.
LOG.debug("{}: Interrupted trying to remove from {} worker's queue", getIdentifier(), key);
return false;
}
}
return true;
}