ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/test/loops/BinaryAsyncAction.java
(Generate patch)

Comparing jsr166/src/test/loops/BinaryAsyncAction.java (file contents):
Revision 1.14 by jsr166, Mon Nov 26 11:47:41 2012 UTC vs.
Revision 1.18 by dl, Sat Sep 12 19:16:16 2015 UTC

# Line 13 | Line 13 | import java.util.concurrent.atomic.*;
13   * have smaller stack space footprints and faster completion mechanics
14   * but higher per-task footprints. Compared to LinkedAsyncActions,
15   * BinaryAsyncActions are simpler to use and have less overhead in
16 < * typical uasges but are restricted to binary computation trees.
16 > * typical usages but are restricted to binary computation trees.
17   *
18   * <p>Upon construction, a BinaryAsyncAction does not bear any
19   * linkages. For non-root tasks, links must be established using
# Line 57 | Line 57 | import java.util.concurrent.atomic.*;
57   * </pre>
58   */
59   public abstract class BinaryAsyncAction extends ForkJoinTask<Void> {
60 <    private volatile int controlState;
61 <
62 <    static final AtomicIntegerFieldUpdater<BinaryAsyncAction> controlStateUpdater =
60 >    private volatile int controlState;  
61 >    
62 >    static final AtomicIntegerFieldUpdater<BinaryAsyncAction> controlStateUpdater =      
63          AtomicIntegerFieldUpdater.newUpdater(BinaryAsyncAction.class, "controlState");
64 <
64 >    
65      /**
66       * Parent to propagate completion; nulled after completion to
67       * avoid retaining entire tree as garbage
# Line 120 | Line 120 | public abstract class BinaryAsyncAction
120       * default version of this method does nothing and returns
121       * {@code true}.
122       * @return true if this task's exception should be propagated to
123 <     * this task's parent.
123 >     * this task's parent
124       */
125      protected boolean onException() {
126          return true;
# Line 169 | Line 169 | public abstract class BinaryAsyncAction
169              a.sibling = null;
170              a.parent = null;
171              a.completeThis();
172 <            if (p == null || p.compareAndSetControlState(0, 1))
172 >            if (p == null ||  p.compareAndSetControlState(0, 1))
173                  break;
174              try {
175                  p.onComplete(a, s);
# Line 282 | Line 282 | public abstract class BinaryAsyncAction
282          controlStateUpdater.decrementAndGet(this);
283      }
284  
285 +
286   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines