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

Comparing jsr166/src/main/java/util/concurrent/ForkJoinTask.java (file contents):
Revision 1.18 by dl, Wed Aug 11 19:44:51 2010 UTC vs.
Revision 1.19 by dl, Sun Aug 29 23:35:07 2010 UTC

# Line 212 | Line 212 | public abstract class ForkJoinTask<V> im
212      }
213  
214      /**
215 <     * Blocks a worker thread until completion. Called only by pool.
215 >     * Blocks a worker thread until completion. Called only by
216 >     * pool. Currently unused -- pool-based waits use timeout
217 >     * version below.
218       */
219      final void internalAwaitDone() {
220          int s;         // the odd construction reduces lock bias effects
# Line 229 | Line 231 | public abstract class ForkJoinTask<V> im
231      }
232  
233      /**
234 +     * Blocks a worker thread until completed or timed out.  Called
235 +     * only by pool.
236 +     *
237 +     * @return status on exit
238 +     */
239 +    final int internalAwaitDone(long millis) {
240 +        int s;
241 +        if ((s = status) >= 0) {
242 +            try {
243 +                synchronized(this) {
244 +                    if (UNSAFE.compareAndSwapInt(this, statusOffset, s,SIGNAL))
245 +                        wait(millis, 0);
246 +                }
247 +            } catch (InterruptedException ie) {
248 +                cancelIfTerminating();
249 +            }
250 +            s = status;
251 +        }
252 +        return s;
253 +    }
254 +
255 +    /**
256       * Blocks a non-worker-thread until completion.
257       */
258      private void externalAwaitDone() {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines