equal
deleted
inserted
replaced
32 * Expert Group and released to the public domain, as explained at |
32 * Expert Group and released to the public domain, as explained at |
33 * http://creativecommons.org/publicdomain/zero/1.0/ |
33 * http://creativecommons.org/publicdomain/zero/1.0/ |
34 */ |
34 */ |
35 |
35 |
36 package java.util.concurrent.locks; |
36 package java.util.concurrent.locks; |
37 import java.util.concurrent.*; |
37 import java.util.concurrent.TimeUnit; |
38 import java.util.Date; |
38 import java.util.Date; |
39 |
39 |
40 /** |
40 /** |
41 * {@code Condition} factors out the {@code Object} monitor |
41 * {@code Condition} factors out the {@code Object} monitor |
42 * methods ({@link Object#wait() wait}, {@link Object#notify notify} |
42 * methods ({@link Object#wait() wait}, {@link Object#notify notify} |
358 long awaitNanos(long nanosTimeout) throws InterruptedException; |
358 long awaitNanos(long nanosTimeout) throws InterruptedException; |
359 |
359 |
360 /** |
360 /** |
361 * Causes the current thread to wait until it is signalled or interrupted, |
361 * Causes the current thread to wait until it is signalled or interrupted, |
362 * or the specified waiting time elapses. This method is behaviorally |
362 * or the specified waiting time elapses. This method is behaviorally |
363 * equivalent to:<br> |
363 * equivalent to: |
364 * <pre> |
364 * <pre> {@code awaitNanos(unit.toNanos(time)) > 0}</pre> |
365 * awaitNanos(unit.toNanos(time)) > 0 |
365 * |
366 * </pre> |
|
367 * @param time the maximum time to wait |
366 * @param time the maximum time to wait |
368 * @param unit the time unit of the {@code time} argument |
367 * @param unit the time unit of the {@code time} argument |
369 * @return {@code false} if the waiting time detectably elapsed |
368 * @return {@code false} if the waiting time detectably elapsed |
370 * before return from the method, else {@code true} |
369 * before return from the method, else {@code true} |
371 * @throws InterruptedException if the current thread is interrupted |
370 * @throws InterruptedException if the current thread is interrupted |