1533 |
|
(m = ws.length - 1) < 0) { // initialize workQueues |
1534 |
|
int p = parallelism; // find power of two table size |
1535 |
|
int n = (p > 1) ? p - 1 : 1; // ensure at least 2 slots |
1536 |
< |
n |= n >>> 1; n |= n >>> 2; n |= n >>> 4; |
1537 |
< |
n |= n >>> 8; n |= n >>> 16; n = (n + 1) << 1; |
1536 |
> |
n |= n >>> 1; |
1537 |
> |
n |= n >>> 2; |
1538 |
> |
n |= n >>> 4; |
1539 |
> |
n |= n >>> 8; |
1540 |
> |
n |= n >>> 16; |
1541 |
> |
n = (n + 1) << 1; |
1542 |
|
WorkQueue[] nws = ((ws = workQueues) == null || ws.length == 0 ? |
1543 |
|
new WorkQueue[n] : null); |
1544 |
|
if (((ps = plock) & PL_LOCK) != 0 || |
2100 |
|
w.currentSteal = ps; |
2101 |
|
} |
2102 |
|
} |
2103 |
< |
else if (active) { // decrement active count without queuing |
2103 |
> |
else if (active) { // decrement active count without queuing |
2104 |
|
long nc = ((c = ctl) & ~AC_MASK) | ((c & AC_MASK) - AC_UNIT); |
2105 |
|
if ((int)(nc >> AC_SHIFT) + parallelism == 0) |
2106 |
|
break; // bypass decrement-then-increment |