v1.9.21
  • Solutions
    • Multiplatform
    • Server-side
    • Data science
    • Android
  • Docs
  • Community
  • Teach
  • Play
    • Playground
    • Examples
    • Koans
← Docs
kotlin-stdlib / kotlin.concurrent / AtomicLongArray / getAndSet

getAndSet

Native
1.3
fun getAndSet(index: Int, newValue: Long): Long
(source)

Atomically sets the value of the element at the given index to the new value and returns the old value of the element.

Provides sequential consistent ordering guarantees.

Exceptions

IndexOutOfBoundsException - if the index is out of bounds of this array.

Stay in touch:
  • Contributing to Kotlin
  • Releases
  • Press Kit
  • Security
  • Blog
  • Issue Tracker
  • Brand assets
  • Careers
Kotlin™ is protected under the Kotlin Foundation and licensed under the Apache 2 license.
Supported and developed by JetBrains