2394 |
|
if ((rs & STOP) == 0) { |
2395 |
|
if (!now) { // check quiescence |
2396 |
|
for (long oldSum = 0L;;) { // repeat until stable |
2397 |
< |
WorkQueue[] ws; WorkQueue w; int m, b, sp; long c; |
2397 |
> |
WorkQueue[] ws; WorkQueue w; int m, b; |
2398 |
|
long checkSum = ctl; |
2399 |
|
if ((int)(checkSum >> AC_SHIFT) + (config & SMASK) > 0) |
2400 |
|
return 0; // still active workers |
2403 |
|
for (int i = 0; i <= m; ++i) { |
2404 |
|
if ((w = ws[i]) != null) { |
2405 |
|
checkSum += (b = w.base); |
2406 |
< |
if (w.currentSteal != null || b != w.top) { |
2407 |
< |
if ((sp = (int)(c = ctl)) == 0 || |
2408 |
< |
tryRelease(c, ws[m & sp], AC_UNIT)) |
2406 |
> |
if (w.currentSteal != null || b != w.top) |
2407 |
|
return 0; // retry if internal caller |
2410 |
– |
} |
2408 |
|
} |
2409 |
|
} |
2410 |
|
if (oldSum == (oldSum = checkSum)) |