5 |
|
*/ |
6 |
|
|
7 |
|
package jsr166e; |
8 |
+ |
|
9 |
|
/** |
10 |
|
* A {@link ForkJoinTask} with a completion action |
11 |
|
* performed when triggered and there are no remaining pending |
429 |
|
} |
430 |
|
} |
431 |
|
else if (U.compareAndSwapInt(a, PENDING, c, c - 1)) { |
432 |
< |
CountedCompleter<?> root = a.getRoot(); |
433 |
< |
Thread thread = Thread.currentThread(); |
433 |
< |
ForkJoinPool.WorkQueue wq = |
434 |
< |
(thread instanceof ForkJoinWorkerThread)? |
435 |
< |
((ForkJoinWorkerThread)thread).workQueue : null; |
436 |
< |
ForkJoinTask<?> t; |
437 |
< |
while ((t = (wq != null) ? wq.popCC(root) : |
438 |
< |
ForkJoinPool.popCCFromCommonPool(root)) != null) { |
439 |
< |
t.doExec(); |
440 |
< |
if (root.isDone()) |
441 |
< |
break; |
442 |
< |
} |
432 |
> |
if (!(Thread.currentThread() instanceof ForkJoinWorkerThread)) |
433 |
> |
ForkJoinPool.popAndExecCCFromCommonPool(a); |
434 |
|
return; |
435 |
|
} |
436 |
|
} |