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 |
|
} |