ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/main/java/util/ArrayPrefixHelpers.java
(Generate patch)

Comparing jsr166/src/main/java/util/ArrayPrefixHelpers.java (file contents):
Revision 1.1 by dl, Wed Jan 16 19:01:22 2013 UTC vs.
Revision 1.9 by jsr166, Sun Sep 20 17:42:24 2015 UTC

# Line 5 | Line 5
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.
# Line 19 | Line 20 | import java.util.function.DoubleBinaryOp
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
# Line 187 | Line 188 | class ArrayPrefixHelpers {
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;
# Line 381 | Line 384 | class ArrayPrefixHelpers {
384  
385          /** Root task constructor */
386          public DoubleCumulateTask(DoubleCumulateTask parent,
387 <                                DoubleBinaryOperator function,
388 <                                double[] array, int lo, int hi) {
387 >                                  DoubleBinaryOperator function,
388 >                                  double[] array, int lo, int hi) {
389              super(parent);
390              this.function = function; this.array = array;
391              this.lo = this.origin = lo; this.hi = this.fence = hi;
# Line 394 | Line 397 | class ArrayPrefixHelpers {
397  
398          /** Subtask constructor */
399          DoubleCumulateTask(DoubleCumulateTask parent, DoubleBinaryOperator function,
400 <                         double[] array, int origin, int fence, int threshold,
401 <                         int lo, int hi) {
400 >                           double[] array, int origin, int fence, int threshold,
401 >                           int lo, int hi) {
402              super(parent);
403              this.function = function; this.array = array;
404              this.origin = origin; this.fence = fence;
# Line 531 | Line 534 | class ArrayPrefixHelpers {
534  
535          /** Root task constructor */
536          public IntCumulateTask(IntCumulateTask parent,
537 <                                IntBinaryOperator function,
538 <                                int[] array, int lo, int hi) {
537 >                               IntBinaryOperator function,
538 >                               int[] array, int lo, int hi) {
539              super(parent);
540              this.function = function; this.array = array;
541              this.lo = this.origin = lo; this.hi = this.fence = hi;
# Line 544 | Line 547 | class ArrayPrefixHelpers {
547  
548          /** Subtask constructor */
549          IntCumulateTask(IntCumulateTask parent, IntBinaryOperator function,
550 <                         int[] array, int origin, int fence, int threshold,
551 <                         int lo, int hi) {
550 >                        int[] array, int origin, int fence, int threshold,
551 >                        int lo, int hi) {
552              super(parent);
553              this.function = function; this.array = array;
554              this.origin = origin; this.fence = fence;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines