AtomicArray
A generic array of objects in which elements may be updated atomically.
Platform-specific implementation details:
When targeting the Native backend, AtomicArray stores an Array with elements of type T and atomically updates it's elements. For additional details about atomicity guarantees for reads and writes see kotlin.concurrent.Volatile.
When targeting the JVM, instances of AtomicArray are represented by java.util.concurrent.atomic.AtomicReferenceArray. 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 AtomicArray is implemented trivially and is not thread-safe since these platforms do not support multi-threading.
Since Kotlin
2.1A generic array of objects in which elements 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 generic array of objects in which elements may be updated atomically.
Instances of AtomicArray are represented by java.util.concurrent.atomic.AtomicReferenceArray and provide the the same atomicity guarantees.
Since Kotlin
2.1A generic array of objects in which elements may be updated atomically.
Read operation loadAt has the same memory effects as reading a Volatile property; Write operation storeAt has the same memory effects as writing a Volatile property; Read-modify-write operations, like exchangeAt, compareAndSetAt, compareAndExchangeAt, 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 generic array of objects in which elements 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 generic array of objects in which elements 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
Creates a new AtomicArray
Creates a new AtomicArray filled with elements of the given array.
Creates a new AtomicArray
Creates a new AtomicArray
Creates a new AtomicArray filled with elements of the given array.
Creates a new AtomicArray filled with elements of the given array.
Functions
Casts the given AtomicArray
Atomically sets the value of the element at the given index to the new value if the current value equals the expected value and returns the old value of the element in any case.
Atomically stores the new value into the element of this AtomicArray at the given index if the current value equals the expected value and returns the old value of the element in any case.
Atomically stores the new value into the element of this AtomicArray at the given index if the current value equals the expected value and returns the old value of the element in any case.
Atomically stores the new value into the element of this AtomicArray at the given index if the current value equals the expected value and returns the old value of the element in any case.
Atomically stores the new value into the element of this AtomicArray at the given index if the current value equals the expected value and returns the old value of the element in any case.
Atomically stores the new value into the element of this AtomicArray at the given index if the current value equals the expected value and returns the old value of the element in any case.
Atomically stores the new value into the element of this AtomicArray at the given index if the current value equals the expected value and returns the old value of the element in any case.
Atomically sets the value of the element at the given index to the new value if the current value equals the expected value. Returns true if the operation was successful and false only if the current value of the element was not equal to the expected value.
Atomically stores the new value into the element of this AtomicArray at the given index if the current value equals the expected value. Returns true if the operation was successful and false only if the current value of the element was not equal to the expected value.
Atomically stores the new value into the element of this AtomicArray at the given index if the current value equals the expected value. Returns true if the operation was successful and false only if the current value of the element was not equal to the expected value.
Atomically stores the new value into the element of this AtomicArray at the given index if the current value equals the expected value. Returns true if the operation was successful and false only if the current value of the element was not equal to the expected value.
Atomically stores the new value into the element of this AtomicArray at the given index if the current value equals the expected value. Returns true if the operation was successful and false only if the current value of the element was not equal to the expected value.
Atomically stores the new value into the element of this AtomicArray at the given index if the current value equals the expected value. Returns true if the operation was successful and false only if the current value of the element was not equal to the expected value.
Atomically stores the new value into the element of this AtomicArray at the given index if the current value equals the expected value. Returns true if the operation was successful and false only if the current value of the element was not equal to the expected value.
Atomically stores the new value into the element of this AtomicArray at the given index and returns the old value of the element.
Atomically stores the new value into the element of this AtomicArray at the given index and returns the old value of the element.
Atomically stores the new value into the element of this AtomicArray at the given index and returns the old value of the element.
Atomically stores the new value into the element of this AtomicArray at the given index and returns the old value of the element.
Atomically stores the new value into the element of this AtomicArray at the given index and returns the old value of the element.
Atomically stores the new value into the element of this AtomicArray at the given index and returns the old value of the element.
Atomically loads the value from the element of this AtomicArray at the given index.
Atomically loads the value from the element of this AtomicArray at the given index.
Atomically loads the value from the element of this AtomicArray at the given index.
Atomically loads the value from the element of this AtomicArray at the given index.
Atomically loads the value from the element of this AtomicArray at the given index.
Atomically loads the value from the element of this AtomicArray at the given index.
Atomically stores the new value into the element of this AtomicArray at the given index.
Atomically stores the new value into the element of this AtomicArray at the given index.
Atomically stores the new value into the element of this AtomicArray at the given index.
Atomically stores the new value into the element of this AtomicArray at the given index.
Atomically stores the new value into the element of this AtomicArray at the given index.
Returns the string representation of the underlying array of objects.
Returns the string representation of the underlying array of objects.
Returns the string representation of the underlying array of objects.
Returns the string representation of the underlying array of objects.
Returns the string representation of the underlying array of objects.