940 |
|
UNSAFE.putOrderedObject(this, currentJoinOffset, joinMe); |
941 |
|
if (isTerminating()) // cancel if shutting down |
942 |
|
joinMe.cancelIgnoringExceptions(); |
943 |
< |
else |
944 |
< |
pool.awaitJoin(joinMe, this, timed, nanos); |
943 |
> |
else { |
944 |
> |
if (sp != base) |
945 |
> |
localHelpJoinTask(joinMe); |
946 |
> |
if (joinMe.status >= 0) |
947 |
> |
pool.awaitJoin(joinMe, this, timed, nanos); |
948 |
> |
} |
949 |
|
UNSAFE.putOrderedObject(this, currentJoinOffset, prevJoin); |
950 |
|
} |
951 |
|
|
1016 |
|
for (int j = 0; ; ++j) { // search array |
1017 |
|
if (j < n) { |
1018 |
|
ForkJoinTask<?> vs; |
1019 |
< |
if ((v = ws[j]) != null && v != this && |
1019 |
> |
if ((v = ws[j]) != null && |
1020 |
> |
(v != this || base == sp) && |
1021 |
|
(vs = v.currentSteal) != null) { |
1022 |
|
if (joinMe.status < 0 || task.status < 0) |
1023 |
|
return; // stale or done |