1 |
|
/* |
2 |
|
* Written by Doug Lea with assistance from members of JCP JSR-166 |
3 |
|
* Expert Group and released to the public domain, as explained at |
4 |
< |
* http://creativecommons.org/licenses/publicdomain |
4 |
> |
* http://creativecommons.org/publicdomain/zero/1.0/ |
5 |
|
*/ |
6 |
|
|
7 |
|
package jsr166y; |
714 |
|
*/ |
715 |
|
private boolean scan(ForkJoinWorkerThread w, int a) { |
716 |
|
int g = scanGuard; // mask 0 avoids useless scans if only one active |
717 |
< |
int m = parallelism == 1 - a? 0 : g & SMASK; |
717 |
> |
int m = (parallelism == 1 - a && blockedCount == 0) ? 0 : g & SMASK; |
718 |
|
ForkJoinWorkerThread[] ws = workers; |
719 |
|
if (ws == null || ws.length <= m) // staleness check |
720 |
|
return false; |