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

Comparing jsr166/src/main/java/util/concurrent/ForkJoinPool.java (file contents):
Revision 1.296 by jsr166, Sat Oct 24 15:53:53 2015 UTC vs.
Revision 1.297 by dl, Sun Nov 22 20:27:33 2015 UTC

# Line 1036 | Line 1036 | public class ForkJoinPool extends Abstra
1036                  ForkJoinTask<?> t = (ForkJoinTask<?>) U.getObject(a, offset);
1037                  if (t == task &&
1038                      U.compareAndSwapInt(this, QLOCK, 0, 1)) {
1039 <                    if (U.compareAndSwapObject(a, offset, task, null)) {
1039 >                    if (top == s + 1 && array == a &&
1040 >                        U.compareAndSwapObject(a, offset, task, null)) {
1041                          popped = true;
1042                          top = s;
1043                      }
# Line 1222 | Line 1223 | public class ForkJoinPool extends Abstra
1223                      for (CountedCompleter<?> r = t;;) {
1224                          if (r == task) {
1225                              if ((mode & IS_OWNED) == 0) {
1226 <                                boolean popped;
1226 >                                boolean popped = false;
1227                                  if (U.compareAndSwapInt(this, QLOCK, 0, 1)) {
1228 <                                    if (popped =
1228 >                                    if (top == s && array == a &&
1229                                          U.compareAndSwapObject(a, offset,
1230 <                                                               t, null))
1230 >                                                               t, null)) {
1231 >                                        popped = true;
1232                                          top = s - 1;
1233 +                                    }
1234                                      U.putOrderedInt(this, QLOCK, 0);
1235                                      if (popped)
1236                                          return t;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines