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

Comparing jsr166/src/jsr166y/ForkJoinTask.java (file contents):
Revision 1.54 by dl, Wed Aug 11 19:44:30 2010 UTC vs.
Revision 1.55 by dl, Sun Aug 29 23:34:46 2010 UTC

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines