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.27 by jsr166, Fri Sep 17 01:24:26 2010 UTC vs.
Revision 1.28 by dl, Fri Sep 17 14:17:16 2010 UTC

# Line 644 | Line 644 | public abstract class ForkJoinTask<V> im
644       * @throws CancellationException {@inheritDoc}
645       */
646      public final V get() throws InterruptedException, ExecutionException {
647 <        quietlyJoin();
648 <        if (Thread.interrupted())
649 <            throw new InterruptedException();
650 <        int s = status;
647 >        int s;
648 >        if (Thread.currentThread() instanceof ForkJoinWorkerThread) {
649 >            quietlyJoin();
650 >            s = status;
651 >        }
652 >        else {
653 >            while ((s = status) >= 0) {
654 >                synchronized (this) { // interruptible form of awaitDone
655 >                    if (UNSAFE.compareAndSwapInt(this, statusOffset,
656 >                                                 s, SIGNAL)) {
657 >                        while (status >= 0)
658 >                            wait();
659 >                    }
660 >                }
661 >            }
662 >        }
663          if (s < NORMAL) {
664              Throwable ex;
665              if (s == CANCELLED)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines