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

Comparing jsr166/src/jsr166e/LongAdder.java (file contents):
Revision 1.14 by jsr166, Mon Jan 14 02:02:41 2013 UTC vs.
Revision 1.15 by dl, Sun May 4 22:38:19 2014 UTC

# Line 55 | Line 55 | public class LongAdder extends Striped64
55       * @param x the value to add
56       */
57      public void add(long x) {
58 <        Cell[] as; long b, v; HashCode hc; Cell a; int n;
58 >        Cell[] as; long b, v; int[] hc; Cell a; int n;
59          if ((as = cells) != null || !casBase(b = base, b + x)) {
60              boolean uncontended = true;
61 <            int h = (hc = threadHashCode.get()).code;
62 <            if (as == null || (n = as.length) < 1 ||
63 <                (a = as[(n - 1) & h]) == null ||
61 >            if ((hc = threadHashCode.get()) == null ||
62 >                as == null || (n = as.length) < 1 ||
63 >                (a = as[(n - 1) & hc[0]]) == null ||
64                  !(uncontended = a.cas(v = a.value, v + x)))
65                  retryUpdate(x, hc, uncontended);
66          }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines