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

Comparing jsr166/src/jsr166e/DoubleMaxUpdater.java (file contents):
Revision 1.9 by jsr166, Mon Jan 14 02:02:41 2013 UTC vs.
Revision 1.12 by jsr166, Mon May 5 20:20:15 2014 UTC

# Line 5 | Line 5
5   */
6  
7   package jsr166e;
8 +
9 + import java.io.IOException;
10 + import java.io.ObjectInputStream;
11 + import java.io.ObjectOutputStream;
12   import java.io.Serializable;
13  
14   /**
# Line 57 | Line 61 | public class DoubleMaxUpdater extends St
61       */
62      public void update(double x) {
63          long lx = Double.doubleToRawLongBits(x);
64 <        Cell[] as; long b, v; HashCode hc; Cell a; int n;
64 >        Cell[] as; long b, v; int[] hc; Cell a; int n;
65          if ((as = cells) != null ||
66              (Double.longBitsToDouble(b = base) < x && !casBase(b, lx))) {
67              boolean uncontended = true;
68 <            int h = (hc = threadHashCode.get()).code;
69 <            if (as == null || (n = as.length) < 1 ||
70 <                (a = as[(n - 1) & h]) == null ||
68 >            if ((hc = threadHashCode.get()) == null ||
69 >                as == null || (n = as.length) < 1 ||
70 >                (a = as[(n - 1) & hc[0]]) == null ||
71                  (Double.longBitsToDouble(v = a.value) < x &&
72                   !(uncontended = a.cas(v, lx))))
73                  retryUpdate(lx, hc, uncontended);
# Line 176 | Line 180 | public class DoubleMaxUpdater extends St
180          return (float)max();
181      }
182  
183 <    private void writeObject(java.io.ObjectOutputStream s)
180 <        throws java.io.IOException {
183 >    private void writeObject(ObjectOutputStream s) throws IOException {
184          s.defaultWriteObject();
185          s.writeDouble(max());
186      }
187  
188 <    private void readObject(java.io.ObjectInputStream s)
189 <        throws java.io.IOException, ClassNotFoundException {
188 >    private void readObject(ObjectInputStream s)
189 >            throws IOException, ClassNotFoundException {
190          s.defaultReadObject();
191          busy = 0;
192          cells = null;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines