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

Comparing jsr166/src/jsr166y/ForkJoinWorkerThread.java (file contents):
Revision 1.55 by dl, Wed Nov 17 15:36:39 2010 UTC vs.
Revision 1.58 by jsr166, Sun Nov 21 08:18:19 2010 UTC

# Line 348 | Line 348 | public class ForkJoinWorkerThread extend
348      /**
349       * Initializes internal state after construction but before
350       * processing any tasks. If you override this method, you must
351 <     * invoke @code{super.onStart()} at the beginning of the method.
351 >     * invoke {@code super.onStart()} at the beginning of the method.
352       * Initialization requires care: Most fields must have legal
353       * default values, to ensure that attempted accesses from other
354       * threads work correctly even before this thread starts
# Line 940 | Line 940 | public class ForkJoinWorkerThread extend
940          UNSAFE.putOrderedObject(this, currentJoinOffset, joinMe);
941          if (isTerminating())                // cancel if shutting down
942              joinMe.cancelIgnoringExceptions();
943 <        else
944 <            pool.awaitJoin(joinMe, this, timed, nanos);
943 >        else {
944 >            if (sp != base)
945 >                localHelpJoinTask(joinMe);
946 >            if (joinMe.status >= 0)
947 >                pool.awaitJoin(joinMe, this, timed, nanos);
948 >        }
949          UNSAFE.putOrderedObject(this, currentJoinOffset, prevJoin);
950      }
951  
# Line 1012 | Line 1016 | public class ForkJoinWorkerThread extend
1016                  for (int j = 0; ; ++j) {      // search array
1017                      if (j < n) {
1018                          ForkJoinTask<?> vs;
1019 <                        if ((v = ws[j]) != null && v != this &&
1019 >                        if ((v = ws[j]) != null &&
1020 >                            (v != this || base == sp) &&
1021                              (vs = v.currentSteal) != null) {
1022                              if (joinMe.status < 0 || task.status < 0)
1023                                  return;       // stale or done

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines