fun compareAndSwap( expected: NativePtr, new: NativePtr ): NativePtr
Compares value with expected and replaces it with new value if values matches. If new value is not null, it must be frozen or permanent object.
expected - the expected value
new - the new value
InvalidMutabilityException - if new is not frozen or a permanent object
Return the old value
© 2010–2019 JetBrains s.r.o.
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.native.concurrent/-atomic-native-ptr/compare-and-swap.html