23 |
|
* the following code will timeout in 50 milliseconds if the {@link |
24 |
|
* java.util.concurrent.locks.Lock lock} is not available: |
25 |
|
* |
26 |
< |
* <pre> {@code |
26 |
> |
* <pre> {@code |
27 |
|
* Lock lock = ...; |
28 |
|
* if (lock.tryLock(50L, TimeUnit.MILLISECONDS)) ...}</pre> |
29 |
|
* |
30 |
|
* while this code will timeout in 50 seconds: |
31 |
< |
* <pre> {@code |
31 |
> |
* <pre> {@code |
32 |
|
* Lock lock = ...; |
33 |
|
* if (lock.tryLock(50L, TimeUnit.SECONDS)) ...}</pre> |
34 |
|
* |
300 |
|
* method (see {@link BlockingQueue#poll BlockingQueue.poll}) |
301 |
|
* using: |
302 |
|
* |
303 |
< |
* <pre> {@code |
303 |
> |
* <pre> {@code |
304 |
|
* public synchronized Object poll(long timeout, TimeUnit unit) |
305 |
|
* throws InterruptedException { |
306 |
|
* while (empty) { |