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.59 by dl, Sun Nov 21 13:55:04 2010 UTC vs.
Revision 1.60 by dl, Tue Nov 23 00:10:39 2010 UTC

# Line 985 | Line 985 | public class ForkJoinWorkerThread extend
985              int s;
986              if (joinMe.status < 0)
987                  return running;
988 <            else if ((runState & TERMINATING) != 0)
988 >            else if ((runState & TERMINATING) != 0) {
989                  joinMe.cancelIgnoringExceptions();
990 +                return running;
991 +            }
992              else if ((s = sp) == base || (q = queue) == null)
993                  break;                            // queue empty
994              else {
# Line 1002 | Line 1004 | public class ForkJoinWorkerThread extend
1004                           UNSAFE.compareAndSwapObject(q, u, t, null)) {
1005                      sp = s; // putOrderedInt may encourage more timely write
1006                      // UNSAFE.putOrderedInt(this, spOffset, s);
1007 <                    if (t.status >= 0)
1006 <                        t.quietlyExec();
1007 >                    t.quietlyExec();
1008                  }
1009              }
1010          }
# Line 1072 | Line 1073 | public class ForkJoinWorkerThread extend
1073                                                      currentStealOffset, ps);
1074                          }
1075                      }
1076 +                    else if ((runState & TERMINATING) != 0) {
1077 +                        joinMe.cancelIgnoringExceptions();
1078 +                        break outer;
1079 +                    }
1080                  }
1081 <
1081 >                
1082                  // Try to descend to find v's stealer
1083                  ForkJoinTask<?> next = v.currentJoin;
1084 <                if (task.status < 0 || next == null || next == task)
1085 <                    break;                       // stale, dead-end, or cyclic
1086 <                if ((runState & TERMINATING) != 0)
1082 <                    joinMe.cancelIgnoringExceptions();
1083 <                if (joinMe.status < 0)
1084 <                    break;
1084 >                if (task.status < 0 || next == null || next == task ||
1085 >                    joinMe.status < 0)
1086 >                    break;                 // done, stale, dead-end, or cyclic
1087                  task = next;
1088                  thread = v;
1089              }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines