Skip to content

Commit

Permalink
Update old AtomicRef
Browse files Browse the repository at this point in the history
  • Loading branch information
nomisRev committed Sep 12, 2023
1 parent 7bfd815 commit 8d83c7c
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package arrow.continuations.generic

import kotlin.native.concurrent.AtomicReference
import kotlin.concurrent.AtomicReference
import kotlin.native.concurrent.freeze
import kotlin.native.concurrent.isFrozen

Expand All @@ -18,7 +18,7 @@ public actual class AtomicRef<V> actual constructor(initialValue: V) {
while (true) {
val cur = atom.value
if (cur === value) return cur
if (atom.compareAndSwap(cur, value) === cur) return cur
if (atom.compareAndSet(cur, value)) return cur
}
}

Expand Down

0 comments on commit 8d83c7c

Please sign in to comment.