AtomicLong
A Long value that may be updated atomically.
Platform-specific implementation details:
When targeting the Native backend, AtomicLong stores a volatile Long variable and atomically updates it. For additional details about atomicity guarantees for reads and writes see kotlin.concurrent.Volatile.
When targeting the JVM, instances of AtomicLong are represented by java.util.concurrent.atomic.AtomicLong. For details about guarantees of volatile accesses and updates of atomics refer to The Java Language Specification (17.4 Memory Model).
For JS and Wasm AtomicLong is implemented trivially and is not thread-safe since these platforms do not support multi-threading.
Since Kotlin
2.1A Long value that may be updated atomically.
Since the JS platform does not support multi-threading, the implementation is trivial and has no atomic synchronizations.
Since Kotlin
2.1A Long value that may be updated atomically.
Instances of AtomicLong are represented by java.util.concurrent.atomic.AtomicLong and provide the the same atomicity guarantees.
Since Kotlin
2.1A Long value that may be updated atomically.
Read operation load has the same memory effects as reading a Volatile property; Write operation store has the same memory effects as writing a Volatile property; Read-modify-write operations, like exchange, compareAndSet, compareAndExchange, fetchAndAdd, addAndFetch, have the same memory effects as reading and writing a Volatile property.
For additional details about atomicity guarantees for reads and writes see kotlin.concurrent.Volatile.
Since Kotlin
2.1A Long value that may be updated atomically.
Since the Wasm platform does not support multi-threading, the implementation is trivial and has no atomic synchronizations.
Since Kotlin
2.1A Long value that may be updated atomically.
Since the Wasm platform does not support multi-threading, the implementation is trivial and has no atomic synchronizations.
Since Kotlin
2.1Constructors
Functions
Atomically adds the given value to the current value of this AtomicLong and returns the new value.
Atomically adds the given value to the current value of this AtomicLong and returns the new value.
Atomically adds the given value to the current value of this AtomicLong and returns the new value.
Atomically adds the given value to the current value of this AtomicLong and returns the new value.
Atomically adds the given value to the current value of this AtomicLong and returns the new value.
Atomically adds the given value to the current value of this AtomicLong and returns the new value.
Atomically adds the given value to the current value and returns the new value.
Casts the given AtomicLong instance to java.util.concurrent.atomic.AtomicLong.
Atomically stores the given new value into this AtomicLong if the current value equals the expected value and returns the old value in any case.
Atomically stores the given new value into this AtomicLong. if the current value equals the expected value and returns the old value in any case.
Atomically stores the given new value into this AtomicLong if the current value equals the expected value and returns the old value in any case.
Atomically stores the given new value into this AtomicLong if the current value equals the expected value and returns the old value in any case.
Atomically stores the given new value into this AtomicLong if the current value equals the expected value and returns the old value in any case.
Atomically stores the given new value into this AtomicLong if the current value equals the expected value and returns the old value in any case.
Atomically stores the given new value into this AtomicLong if the current value equals the expected value, returns true if the operation was successful and false only if the current value was not equal to the expected value.
Atomically stores the given new value into this AtomicLong. if the current value equals the expected value, returns true if the operation was successful and false only if the current value was not equal to the expected value.
Atomically stores the given new value into this AtomicLong if the current value equals the expected value, returns true if the operation was successful and false only if the current value was not equal to the expected value.
Atomically stores the given new value into this AtomicLong if the current value equals the expected value, returns true if the operation was successful and false only if the current value was not equal to the expected value.
Atomically stores the given new value into this AtomicLong if the current value equals the expected value, returns true if the operation was successful and false only if the current value was not equal to the expected value.
Atomically stores the given new value into this AtomicLong if the current value equals the expected value, returns true if the operation was successful and false only if the current value was not equal to the expected value.
Atomically decrements the current value of this AtomicLong by one and returns the new value.
Atomically decrements the current value by one and returns the new value.
Atomically stores the given new value into this AtomicLong. and returns the old value.
Atomically stores the given new value into this AtomicLong. and returns the old value.
Atomically stores the given new value into this AtomicLong and returns the old value.
Atomically stores the new value into this AtomicLong and returns the old value.
Atomically stores the given new value into this AtomicLong and returns the old value.
Atomically stores the given new value into this AtomicLong and returns the old value.
Atomically adds the given value to the current value of this AtomicLong and returns the old value.
Atomically adds the given value to the current value of this AtomicLong and returns the old value.
Atomically adds the given value to the current value of this AtomicLong and returns the old value.
Atomically adds the given value to the current value of this AtomicLong and returns the old value.
Atomically adds the given value to the current value of this AtomicLong and returns the old value.
Atomically adds the given value to the current value of this AtomicLong and returns the old value.
Atomically decrements the current value of this AtomicLong by one and returns the old value.
Atomically increments the current value of this AtomicLong by one and returns the old value.
Atomically adds the given value to the current value and returns the old value.
Atomically decrements the current value by one and returns the old value.
Atomically increments the current value by one and returns the old value.
Atomically increments the current value of this AtomicLong by one and returns the new value.
Atomically increments the current value by one and returns the new value.
Atomically subtracts the given value from the current value of this AtomicLong.
Atomically adds the given value to the current value of this AtomicLong.
Atomically stores the new value into this AtomicLong.
Atomically stores the new value into this AtomicLong.
Atomically stores the new value into this AtomicLong.
Atomically stores the new value into this AtomicLong.
Atomically stores the new value into this AtomicLong.
Atomically stores the new value into this AtomicLong.
Returns the string representation of the underlying Long value.
Returns the string representation of the underlying Long value.
Returns the string representation of the underlying Long value.
Returns the string representation of the underlying Long value.
Returns the string representation of the underlying Long value.