5 |
|
*/ |
6 |
|
|
7 |
|
package java.util; |
8 |
< |
import java.util.concurrent.ForkJoinPool; |
8 |
> |
|
9 |
|
import java.util.concurrent.CountedCompleter; |
10 |
+ |
import java.util.concurrent.ForkJoinPool; |
11 |
|
import java.util.function.BinaryOperator; |
12 |
+ |
import java.util.function.DoubleBinaryOperator; |
13 |
|
import java.util.function.IntBinaryOperator; |
14 |
|
import java.util.function.LongBinaryOperator; |
13 |
– |
import java.util.function.DoubleBinaryOperator; |
15 |
|
|
16 |
|
/** |
17 |
|
* ForkJoin tasks to perform Arrays.parallelPrefix operations. |
20 |
|
* @since 1.8 |
21 |
|
*/ |
22 |
|
class ArrayPrefixHelpers { |
23 |
< |
private ArrayPrefixHelpers() {}; // non-instantiable |
23 |
> |
private ArrayPrefixHelpers() {} // non-instantiable |
24 |
|
|
25 |
|
/* |
26 |
|
* Parallel prefix (aka cumulate, scan) task classes |
188 |
|
sum = t.in; |
189 |
|
t.out = sum; |
190 |
|
for (CumulateTask<T> par;;) { // propagate |
191 |
< |
if ((par = (CumulateTask<T>)t.getCompleter()) == null) { |
191 |
> |
@SuppressWarnings("unchecked") CumulateTask<T> partmp |
192 |
> |
= (CumulateTask<T>)t.getCompleter(); |
193 |
> |
if ((par = partmp) == null) { |
194 |
|
if ((state & FINISHED) != 0) // enable join |
195 |
|
t.quietlyComplete(); |
196 |
|
break outer; |