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

Comparing jsr166/src/main/java/util/concurrent/FutureTask.java (file contents):
Revision 1.29 by dl, Mon Jan 19 15:49:02 2004 UTC vs.
Revision 1.30 by dl, Mon Feb 9 00:23:55 2004 UTC

# Line 75 | Line 75 | public class FutureTask<V> implements Fu
75          return sync.innerCancel(mayInterruptIfRunning);
76      }
77      
78    /**
79     * Waits if necessary for execution to complete, and then
80     * retrieves its result.
81     *
82     * @return computed result
83     * @throws CancellationException if underlying computation was
84     * cancelled
85     * @throws ExecutionException if underlying computation threw an
86     * exception
87     * @throws InterruptedException if current thread was interrupted
88     * while waiting
89     */
78      public V get() throws InterruptedException, ExecutionException {
79          return sync.innerGet();
80      }
81  
94    /**
95     * Waits if necessary for at most the given time for execution to
96     * complete, and then retrieves its result, if available.
97     *
98     * @param timeout the maximum time to wait
99     * @param unit the time unit of the timeout argument
100     * @return computed result
101     * @throws CancellationException if underlying computation was
102     * cancelled
103     * @throws ExecutionException if underlying computation threw an
104     * exception
105     * @throws InterruptedException if current thread was interrupted
106     * while waiting
107     * @throws TimeoutException if the wait timed out
108     */
82      public V get(long timeout, TimeUnit unit)
83          throws InterruptedException, ExecutionException, TimeoutException {
84          return sync.innerGet(unit.toNanos(timeout));
# Line 150 | Line 123 | public class FutureTask<V> implements Fu
123      }
124  
125      /**
126 <     * Executes the computation without setting result, and then
127 <     * resets this Future to initial state; failing to do so if the
126 >     * Executes the computation without setting its result, and then
127 >     * resets this Future to initial state, failing to do so if the
128       * computation encounters an exception or is cancelled.  This is
129       * designed for use with tasks that intrinsically execute more
130       * than once.
# Line 163 | Line 136 | public class FutureTask<V> implements Fu
136  
137      /**
138       * Synchronization control for FutureTask. Note that this must be
139 <     * a non-static inner class in order to invoke protected
139 >     * a non-static inner class in order to invoke the protected
140       * <tt>done</tt> method. For clarity, all inner class support
141       * methods are same as outer, prefixed with "inner".
142       *

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines