# | Line 313 | Line 313 | public enum TimeUnit { | |
---|---|---|
313 | * using: | |
314 | * | |
315 | * <pre> {@code | |
316 | < | * public synchronized E poll(long timeout, TimeUnit unit) |
316 | > | * public E poll(long timeout, TimeUnit unit) |
317 | * throws InterruptedException { | |
318 | < | * while (empty) { |
319 | < | * unit.timedWait(this, timeout); |
320 | < | * ... |
318 | > | * synchronized (lock) { |
319 | > | * while (isEmpty()) { |
320 | > | * unit.timedWait(this, timeout); |
321 | > | * ... |
322 | > | * } |
323 | * } | |
324 | * }}</pre> | |
325 | * |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |