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> Lock lock = ...; |
27 |
< |
* if (lock.tryLock(50L, TimeUnit.MILLISECONDS)) ... |
28 |
< |
* </pre> |
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> |
32 |
< |
* Lock lock = ...; |
33 |
< |
* if (lock.tryLock(50L, TimeUnit.SECONDS)) ... |
33 |
< |
* </pre> |
31 |
> |
* <pre> {@code |
32 |
> |
* Lock lock = ...; |
33 |
> |
* if (lock.tryLock(50L, TimeUnit.SECONDS)) ...}</pre> |
34 |
|
* |
35 |
|
* Note however, that there is no guarantee that a particular timeout |
36 |
|
* implementation will be able to notice the passage of time at the |