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.251 by jsr166, Mon Jul 27 02:55:34 2015 UTC vs.
Revision 1.252 by dl, Wed Jul 29 17:03:47 2015 UTC

# Line 1816 | Line 1816 | public class ForkJoinPool extends Abstra
1816                      long offset = (((al - 1) & b) << ASHIFT) + ABASE;
1817                      ForkJoinTask<?> t = (ForkJoinTask<?>)
1818                          U.getObjectVolatile(a, offset);
1819 <                    ++npolls;
1820 <                    if (t != null && b++ == q.base) {
1821 <                        if (ss < 0) {
1819 >                    if (b++ == q.base) {
1820 >                        if (t == null)
1821 >                            break;                 // empty or busy
1822 >                        else if (ss < 0) {
1823                              tryReactivate(w, ws, r);
1824 <                            if ((ss = w.scanState) < 0)
1824 <                                break;             // retry upon rescan
1824 >                            break;                 // retry upon rescan
1825                          }
1826                          else if (U.compareAndSwapObject(a, offset, t, null)) {
1827                              q.base = b;
# Line 1829 | Line 1829 | public class ForkJoinPool extends Abstra
1829                              if (d != -1)           // propagate signal
1830                                  signalWork(false);
1831                              w.runTask(t);
1832 +                            if (++npolls > limit)
1833 +                                break;
1834                          }
1835                          else
1836                              break;                 // contention
1837                      }
1836                    if (npolls > limit)
1837                        break;
1838                  }
1839                  else if (npolls != 0)              // rescan
1840                      break;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines