ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/main/java/util/concurrent/TimeUnit.java
(Generate patch)

Comparing jsr166/src/main/java/util/concurrent/TimeUnit.java (file contents):
Revision 1.35 by jsr166, Sun May 20 08:23:00 2007 UTC vs.
Revision 1.36 by jsr166, Fri Oct 22 05:52:55 2010 UTC

# Line 24 | Line 24 | package java.util.concurrent;
24   * java.util.concurrent.locks.Lock lock} is not available:
25   *
26   * <pre>  Lock lock = ...;
27 < *  if ( lock.tryLock(50L, TimeUnit.MILLISECONDS) ) ...
27 > *  if (lock.tryLock(50L, TimeUnit.MILLISECONDS)) ...
28   * </pre>
29   * while this code will timeout in 50 seconds:
30   * <pre>
31   *  Lock lock = ...;
32 < *  if ( lock.tryLock(50L, TimeUnit.SECONDS) ) ...
32 > *  if (lock.tryLock(50L, TimeUnit.SECONDS)) ...
33   * </pre>
34   *
35   * Note however, that there is no guarantee that a particular timeout
# Line 270 | Line 270 | public enum TimeUnit {
270       * method (see {@link BlockingQueue#poll BlockingQueue.poll})
271       * using:
272       *
273 <     * <pre>  public synchronized Object poll(long timeout, TimeUnit unit) throws InterruptedException {
274 <     *    while (empty) {
275 <     *      unit.timedWait(this, timeout);
276 <     *      ...
277 <     *    }
278 <     *  }</pre>
273 >     *  <pre> {@code
274 >     * public synchronized Object poll(long timeout, TimeUnit unit)
275 >     *     throws InterruptedException {
276 >     *   while (empty) {
277 >     *     unit.timedWait(this, timeout);
278 >     *     ...
279 >     *   }
280 >     * }}</pre>
281       *
282       * @param obj the object to wait on
283       * @param timeout the maximum time to wait. If less than

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines