All Downloads are FREE. Search and download functionalities are using the official Maven repository.

nativeMain.app.cash.sqldelight.internal.Atomics.kt Maven / Gradle / Ivy

The newest version!
package app.cash.sqldelight.internal

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

actual class Atomic actual constructor(value: V) {
  private val atomicRef = AtomicReference(value)

  actual fun get() = atomicRef.value
  actual fun set(value: V) {
    atomicRef.value = value.freeze()
  }
}

actual class AtomicBoolean actual constructor(value: Boolean) {
  private val atomicBoolean = co.touchlab.stately.concurrency.AtomicBoolean(value)

  actual fun get() = atomicBoolean.value
  actual fun set(value: Boolean) {
    atomicBoolean.value = value
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy