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

Comparing jsr166/src/jsr166y/ForkJoinPool.java (file contents):
Revision 1.155 by jsr166, Sat Dec 8 20:49:24 2012 UTC vs.
Revision 1.156 by dl, Thu Dec 13 20:47:38 2012 UTC

# Line 1846 | Line 1846 | public class ForkJoinPool extends Abstra
1846       */
1847      private void helpSignalHint(WorkQueue caller) {
1848          WorkQueue[] ws; WorkQueue q, w; Thread p; long c; int h, m, u, e, i, s;
1849 <        if (caller != null && (h = caller.hint) >= 0 &&
1850 <            (u = (int)(ctl >>> 32)) < 0 && (u >> UAC_SHIFT) < 0 &&
1851 <            (ws = workQueues) != null && (m = ws.length - 1) >= 0 &&
1852 <            (q = ws[h & m]) != null) {
1849 >        if (caller != null && (h = caller.hint) >= 0) {
1850              caller.hint = -1;
1851 <            for (int n = 2;;) { // limit to at most 2 signals
1852 <                int idleCount = (caller.eventCount < 0) ? 0 : -1;
1853 <                if (((s = idleCount - q.base + q.top) <= n && (n = s) <= 0) ||
1854 <                    (u = (int)((c = ctl) >>> 32)) >= 0 ||
1855 <                    (e = (int)c) <= 0 || m < (i = e & SMASK) ||
1856 <                    (w = ws[i]) == null)
1857 <                    break;
1858 <                long nc = (((long)(w.nextWait & E_MASK)) |
1859 <                           ((long)(u + UAC_UNIT) << 32));
1860 <                if (w.eventCount == (e | INT_SIGN) &&
1864 <                    U.compareAndSwapLong(this, CTL, c, nc)) {
1865 <                    w.hint = h;
1866 <                    w.eventCount = (e + E_SEQ) & E_MASK;
1867 <                    if ((p = w.parker) != null)
1868 <                        U.unpark(p);
1869 <                    if (--n <= 0)
1851 >            if ((u = (int)(ctl >>> 32)) < 0 && (u >> UAC_SHIFT) < 0 &&
1852 >                (ws = workQueues) != null && (m = ws.length - 1) >= 0 &&
1853 >                (q = ws[h & m]) != null) {
1854 >                for (int n = 2;;) { // limit to at most 2 signals
1855 >                    int idleCount = (caller.eventCount < 0) ? 0 : -1;
1856 >                    if (((s = idleCount - q.base + q.top) <= n &&
1857 >                         (n = s) <= 0) ||
1858 >                        (u = (int)((c = ctl) >>> 32)) >= 0 ||
1859 >                        (e = (int)c) <= 0 || m < (i = e & SMASK) ||
1860 >                        (w = ws[i]) == null)
1861                          break;
1862 +                    long nc = (((long)(w.nextWait & E_MASK)) |
1863 +                               ((long)(u + UAC_UNIT) << 32));
1864 +                    if (w.eventCount == (e | INT_SIGN) &&
1865 +                        U.compareAndSwapLong(this, CTL, c, nc)) {
1866 +                        w.hint = h;
1867 +                        w.eventCount = (e + E_SEQ) & E_MASK;
1868 +                        if ((p = w.parker) != null)
1869 +                            U.unpark(p);
1870 +                        if (--n <= 0)
1871 +                            break;
1872 +                    }
1873                  }
1874              }
1875          }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines