19 |
|
* #longValue}) returns the current total combined across the |
20 |
|
* variables maintaining the sum. |
21 |
|
* |
22 |
< |
* <p> This class is usually preferable to {@link AtomicLong} when |
22 |
> |
* <p>This class is usually preferable to {@link AtomicLong} when |
23 |
|
* multiple threads update a common sum that is used for purposes such |
24 |
|
* as collecting statistics, not for fine-grained synchronization |
25 |
|
* control. Under low update contention, the two classes have similar |
28 |
|
* consumption. |
29 |
|
* |
30 |
|
* <p>This class extends {@link Number}, but does <em>not</em> define |
31 |
< |
* methods such as {@code hashCode} and {@code compareTo} because |
32 |
< |
* instances are expected to be mutated, and so are not useful as |
33 |
< |
* collection keys. |
31 |
> |
* methods such as {@code equals}, {@code hashCode} and {@code |
32 |
> |
* compareTo} because instances are expected to be mutated, and so are |
33 |
> |
* not useful as collection keys. |
34 |
|
* |
35 |
|
* <p><em>jsr166e note: This class is targeted to be placed in |
36 |
< |
* java.util.concurrent.atomic<em> |
36 |
> |
* java.util.concurrent.atomic.</em> |
37 |
|
* |
38 |
|
* @since 1.8 |
39 |
|
* @author Doug Lea |
85 |
|
|
86 |
|
/** |
87 |
|
* Returns the current sum. The returned value is <em>NOT</em> an |
88 |
< |
* atomic snapshot: Invocation in the absence of concurrent |
88 |
> |
* atomic snapshot: invocation in the absence of concurrent |
89 |
|
* updates returns an accurate result, but concurrent updates that |
90 |
|
* occur while the sum is being calculated might not be |
91 |
|
* incorporated. |