40 |
|
public class AtomicDouble extends Number implements java.io.Serializable { |
41 |
|
private static final long serialVersionUID = -8405198993435143622L; |
42 |
|
|
43 |
< |
private volatile long value; |
43 |
> |
private volatile transient long value; |
44 |
|
|
45 |
|
/** |
46 |
|
* Creates a new {@code AtomicDouble} with the given initial value. |
210 |
|
return get(); |
211 |
|
} |
212 |
|
|
213 |
+ |
/** |
214 |
+ |
* Saves the state to a stream (that is, serializes it). |
215 |
+ |
* |
216 |
+ |
* @serialData The current value is emitted (a {@code double}). |
217 |
+ |
*/ |
218 |
+ |
private void writeObject(java.io.ObjectOutputStream s) |
219 |
+ |
throws java.io.IOException{ |
220 |
+ |
s.defaultWriteObject(); |
221 |
+ |
|
222 |
+ |
s.writeDouble(get()); |
223 |
+ |
} |
224 |
+ |
|
225 |
+ |
/** |
226 |
+ |
* Reconstitutes the instance from a stream (that is, deserializes it). |
227 |
+ |
*/ |
228 |
+ |
private void readObject(java.io.ObjectInputStream s) |
229 |
+ |
throws java.io.IOException, ClassNotFoundException { |
230 |
+ |
s.defaultReadObject(); |
231 |
+ |
|
232 |
+ |
set(s.readDouble()); |
233 |
+ |
} |
234 |
+ |
|
235 |
|
// Unsafe mechanics |
236 |
|
private static final sun.misc.Unsafe unsafe = getUnsafe(); |
237 |
|
private static final long valueOffset; |