/** * Updates the maximum to be at least the given value. * * @param x the value to update */ public void update(long x) { Cell[] as; long b, v; HashCode hc; Cell a; int n; if ((as = cells) != null || (b = base) < x && !casBase(b, x)) { boolean uncontended = true; int h = (hc = threadHashCode.get()).code; if (as == null || (n = as.length) < 1 || (a = as[(n - 1) & h]) == null || ((v = a.value) < x && !(uncontended = a.cas(v, x)))) retryUpdate(x, hc, uncontended); } }
/** * Updates the maximum to be at least the given value. * * @param x the value to update */ public void update(long x) { Cell[] as; long b, v; HashCode hc; Cell a; int n; if ((as = cells) != null || (b = base) < x && !casBase(b, x)) { boolean uncontended = true; int h = (hc = threadHashCode.get()).code; if (as == null || (n = as.length) < 1 || (a = as[(n - 1) & h]) == null || ((v = a.value) < x && !(uncontended = a.cas(v, x)))) retryUpdate(x, hc, uncontended); } }