jdk/src/share/classes/java/util/concurrent/locks/Condition.java
changeset 14325 622c473a21aa
parent 9242 ef138d47df58
child 18576 7a5c231327af
equal deleted inserted replaced
14324:3510b4bf90ee 14325:622c473a21aa
    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)) &gt; 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