diff --git a/kotlin-native/backend.native/tests/interop/kt44283/main.kt b/kotlin-native/backend.native/tests/interop/kt44283/main.kt index 09a5855eed6..a4458552783 100644 --- a/kotlin-native/backend.native/tests/interop/kt44283/main.kt +++ b/kotlin-native/backend.native/tests/interop/kt44283/main.kt @@ -2,7 +2,7 @@ import kotlinx.cinterop.* import kt44283.* -import kotlin.native.concurrent.AtomicInt +import kotlin.concurrent.AtomicInt import kotlin.test.* val callbackCounter = AtomicInt(0) @@ -14,7 +14,7 @@ fun main() { memScoped { println("Hello, Kotlin/Native! ${it.ptr.pointed.d}") } - callbackCounter.increment() + callbackCounter.incrementAndGet() } assertEquals(0, callbackCounter.value) diff --git a/kotlin-native/backend.native/tests/interop/leakMemoryWithRunningThread/checked.kt b/kotlin-native/backend.native/tests/interop/leakMemoryWithRunningThread/checked.kt index cc4c4c390bd..01a70a596a7 100644 --- a/kotlin-native/backend.native/tests/interop/leakMemoryWithRunningThread/checked.kt +++ b/kotlin-native/backend.native/tests/interop/leakMemoryWithRunningThread/checked.kt @@ -1,6 +1,7 @@ @file:OptIn(kotlin.experimental.ExperimentalNativeApi::class, kotlin.native.runtime.NativeRuntimeApi::class) import leakMemory.* +import kotlin.concurrent.AtomicInt import kotlin.native.concurrent.* import kotlin.native.Platform import kotlin.test.* diff --git a/kotlin-native/backend.native/tests/interop/leakMemoryWithRunningThread/unchecked.kt b/kotlin-native/backend.native/tests/interop/leakMemoryWithRunningThread/unchecked.kt index 0caa39536aa..480e1b94fb6 100644 --- a/kotlin-native/backend.native/tests/interop/leakMemoryWithRunningThread/unchecked.kt +++ b/kotlin-native/backend.native/tests/interop/leakMemoryWithRunningThread/unchecked.kt @@ -1,6 +1,7 @@ @file:OptIn(kotlin.experimental.ExperimentalNativeApi::class, kotlin.native.runtime.NativeRuntimeApi::class) import leakMemory.* +import kotlin.concurrent.AtomicInt import kotlin.native.concurrent.* import kotlin.native.Platform import kotlin.test.* diff --git a/kotlin-native/backend.native/tests/interop/objc/kt56402/main.kt b/kotlin-native/backend.native/tests/interop/objc/kt56402/main.kt index c9500698f21..774feab69b0 100644 --- a/kotlin-native/backend.native/tests/interop/objc/kt56402/main.kt +++ b/kotlin-native/backend.native/tests/interop/objc/kt56402/main.kt @@ -6,6 +6,7 @@ import objclib.* +import kotlin.concurrent.AtomicInt import kotlin.native.concurrent.* import kotlin.native.internal.test.testLauncherEntryPoint import kotlin.system.exitProcess diff --git a/kotlin-native/backend.native/tests/interop/objc/tests/workerAutoreleasePool.kt b/kotlin-native/backend.native/tests/interop/objc/tests/workerAutoreleasePool.kt index 22af9b12f2a..79dbd38ea61 100644 --- a/kotlin-native/backend.native/tests/interop/objc/tests/workerAutoreleasePool.kt +++ b/kotlin-native/backend.native/tests/interop/objc/tests/workerAutoreleasePool.kt @@ -1,5 +1,6 @@ @file:OptIn(FreezingIsDeprecated::class, ObsoleteWorkersApi::class) +import kotlin.concurrent.AtomicReference import kotlin.native.concurrent.* import kotlinx.cinterop.* import kotlin.test.* diff --git a/kotlin-native/backend.native/tests/objcexport/values.kt b/kotlin-native/backend.native/tests/objcexport/values.kt index ba783ddc151..dc441fc5de3 100644 --- a/kotlin-native/backend.native/tests/objcexport/values.kt +++ b/kotlin-native/backend.native/tests/objcexport/values.kt @@ -9,6 +9,7 @@ package conversions +import kotlin.concurrent.AtomicReference import kotlin.native.concurrent.freeze import kotlin.native.concurrent.isFrozen import kotlin.native.internal.ObjCErrorException @@ -946,7 +947,7 @@ class TestStringConversion { lateinit var str: Any } -fun foo(a: kotlin.native.concurrent.AtomicReference<*>) {} +fun foo(a: kotlin.concurrent.AtomicReference<*>) {} interface GH3825 { @Throws(MyException::class) fun call0(callback: () -> Boolean) diff --git a/kotlin-native/backend.native/tests/runtime/atomics/atomic0.kt b/kotlin-native/backend.native/tests/runtime/atomics/atomic0.kt index a4660b48206..4329f6b26ae 100644 --- a/kotlin-native/backend.native/tests/runtime/atomics/atomic0.kt +++ b/kotlin-native/backend.native/tests/runtime/atomics/atomic0.kt @@ -137,7 +137,7 @@ fun test6() { @Suppress("DEPRECATION_ERROR") fun test7() { - val ref = FreezableAtomicReference(Array(1) { "hey" }) + val ref = AtomicReference(Array(1) { "hey" }) ref.value[0] = "ho" assertEquals(ref.value[0], "ho") ref.value = Array(1) { "po" } diff --git a/kotlin-native/backend.native/tests/runtime/atomics/atomic1.kt b/kotlin-native/backend.native/tests/runtime/atomics/atomic1.kt index c99ecb2e0c6..eff1a0871f8 100644 --- a/kotlin-native/backend.native/tests/runtime/atomics/atomic1.kt +++ b/kotlin-native/backend.native/tests/runtime/atomics/atomic1.kt @@ -8,6 +8,7 @@ import kotlin.test.* +import kotlin.concurrent.AtomicInt import kotlin.native.concurrent.* import kotlin.native.internal.* import kotlin.native.runtime.GC @@ -37,7 +38,7 @@ fun main() { val atomics = Array(atomicsCount) { AtomicReference(Any().freeze()) } - createdCount.increment() + createdCount.incrementAndGet() while (canStartReading.value == 0) {} GC.collect() atomics.all { it.value != null } diff --git a/kotlin-native/backend.native/tests/runtime/basic/cleaner_basic.kt b/kotlin-native/backend.native/tests/runtime/basic/cleaner_basic.kt index 7863e5fb757..59b3298d41d 100644 --- a/kotlin-native/backend.native/tests/runtime/basic/cleaner_basic.kt +++ b/kotlin-native/backend.native/tests/runtime/basic/cleaner_basic.kt @@ -10,6 +10,8 @@ package runtime.basic.cleaner_basic import kotlin.test.* import kotlin.native.internal.* +import kotlin.concurrent.AtomicInt +import kotlin.concurrent.AtomicNativePtr import kotlin.native.concurrent.* import kotlin.native.ref.WeakReference import kotlin.native.ref.Cleaner diff --git a/kotlin-native/backend.native/tests/runtime/basic/cleaner_in_tls_worker.kt b/kotlin-native/backend.native/tests/runtime/basic/cleaner_in_tls_worker.kt index c757d47c7c0..e8ba79ada16 100644 --- a/kotlin-native/backend.native/tests/runtime/basic/cleaner_in_tls_worker.kt +++ b/kotlin-native/backend.native/tests/runtime/basic/cleaner_in_tls_worker.kt @@ -6,6 +6,7 @@ import kotlin.test.* +import kotlin.concurrent.AtomicInt import kotlin.native.concurrent.* import kotlin.native.internal.* import kotlin.native.ref.Cleaner diff --git a/kotlin-native/backend.native/tests/runtime/basic/cleaner_workers.kt b/kotlin-native/backend.native/tests/runtime/basic/cleaner_workers.kt index 4d2dff869fc..d8591d7e275 100644 --- a/kotlin-native/backend.native/tests/runtime/basic/cleaner_workers.kt +++ b/kotlin-native/backend.native/tests/runtime/basic/cleaner_workers.kt @@ -9,6 +9,8 @@ package runtime.basic.cleaner_workers import kotlin.test.* import kotlin.native.internal.* +import kotlin.concurrent.AtomicInt +import kotlin.concurrent.AtomicReference import kotlin.native.concurrent.* import kotlin.native.ref.WeakReference import kotlin.native.ref.Cleaner diff --git a/kotlin-native/backend.native/tests/runtime/basic/initializers6.kt b/kotlin-native/backend.native/tests/runtime/basic/initializers6.kt index 5e5345c8e9b..62ff673cb66 100644 --- a/kotlin-native/backend.native/tests/runtime/basic/initializers6.kt +++ b/kotlin-native/backend.native/tests/runtime/basic/initializers6.kt @@ -7,10 +7,9 @@ package runtime.basic.initializers6 import kotlin.test.* - -import kotlin.native.concurrent.* -import kotlin.concurrent.* import kotlin.concurrent.AtomicInt +import kotlin.concurrent.* +import kotlin.native.concurrent.* val aWorkerId = AtomicInt(0) val bWorkersCount = 3 diff --git a/kotlin-native/backend.native/tests/runtime/concurrent/worker_bound_reference0.kt b/kotlin-native/backend.native/tests/runtime/concurrent/worker_bound_reference0.kt index 535e2a723e6..12fb269feae 100644 --- a/kotlin-native/backend.native/tests/runtime/concurrent/worker_bound_reference0.kt +++ b/kotlin-native/backend.native/tests/runtime/concurrent/worker_bound_reference0.kt @@ -8,6 +8,8 @@ package runtime.concurrent.worker_bound_reference0 import kotlin.test.* +import kotlin.concurrent.AtomicInt +import kotlin.concurrent.AtomicReference import kotlin.native.concurrent.* import kotlin.native.* import kotlin.native.ref.WeakReference @@ -108,7 +110,7 @@ fun testGlobalAccessOnWorkerFrozenBeforeAccess() { val worker = Worker.start() val future = worker.execute(TransferMode.SAFE, { semaphore }) { semaphore -> - semaphore.increment() + semaphore.incrementAndGet() while (semaphore.value < 2) { } @@ -118,7 +120,7 @@ fun testGlobalAccessOnWorkerFrozenBeforeAccess() { while (semaphore.value < 1) { } global5.value.freeze() - semaphore.increment() + semaphore.incrementAndGet() val value = future.result assertEquals(3, value) @@ -135,7 +137,7 @@ fun testGlobalModification() { val worker = Worker.start() val future = worker.execute(TransferMode.SAFE, { semaphore }) { semaphore -> - semaphore.increment() + semaphore.incrementAndGet() while (semaphore.value < 2) { } global6 @@ -144,7 +146,7 @@ fun testGlobalModification() { while (semaphore.value < 1) { } global6.value.a = 4 - semaphore.increment() + semaphore.incrementAndGet() val value = future.result assertEquals(4, value.value.a) @@ -262,7 +264,7 @@ fun testLocalAccessOnWorkerFrozenBeforeAccessFrozen() { val worker = Worker.start() val future = worker.execute(TransferMode.SAFE, { Pair(local, semaphore) }) { (local, semaphore) -> - semaphore.increment() + semaphore.incrementAndGet() while (semaphore.value < 2) { } @@ -272,7 +274,7 @@ fun testLocalAccessOnWorkerFrozenBeforeAccessFrozen() { while (semaphore.value < 1) { } local.value.freeze() - semaphore.increment() + semaphore.incrementAndGet() val value = future.result assertEquals(3, value) @@ -321,7 +323,7 @@ fun testLocalModificationFrozen() { val worker = Worker.start() val future = worker.execute(TransferMode.SAFE, { Pair(local, semaphore) }) { (local, semaphore) -> - semaphore.increment() + semaphore.incrementAndGet() while (semaphore.value < 2) { } local @@ -330,7 +332,7 @@ fun testLocalModificationFrozen() { while (semaphore.value < 1) { } local.value.a = 4 - semaphore.increment() + semaphore.incrementAndGet() val value = future.result assertEquals(4, value.value.a) @@ -432,9 +434,9 @@ fun testLocalAccessWithWrapperFrozen() { worker.requestTermination().result } -fun getOwnerAndWeaks(initial: Int): Triple?>, WeakReference>, WeakReference> { +fun getOwnerAndWeaks(initial: Int): Triple?>, WeakReference>, WeakReference> { val ref = WorkerBoundReference(A(initial)) - val refOwner: FreezableAtomicReference?> = FreezableAtomicReference(ref) + val refOwner: AtomicReference?> = AtomicReference(ref) val refWeak = WeakReference(ref) val refValueWeak = WeakReference(ref.value) @@ -485,7 +487,7 @@ fun collectInWorkerFrozen(worker: Worker, semaphore: AtomicInt): Pair - semaphore.increment() + semaphore.incrementAndGet() while (semaphore.value < 2) { } @@ -510,7 +512,7 @@ fun testCollectInWorkerFrozen() { val worker = Worker.start() val (refValueWeak, future) = collectInWorkerFrozen(worker, semaphore) - semaphore.increment() + semaphore.incrementAndGet() future.result // At this point WorkerBoundReference no longer has a reference, so it's referent is destroyed. @@ -524,7 +526,7 @@ fun doNotCollectInWorkerFrozen(worker: Worker, semaphore: AtomicInt): Future - semaphore.increment() + semaphore.incrementAndGet() while (semaphore.value < 2) { } @@ -543,7 +545,7 @@ fun testDoNotCollectInWorkerFrozen() { while (semaphore.value < 1) { } GC.collect() - semaphore.increment() + semaphore.incrementAndGet() val value = future.result assertEquals(3, value.value.a) @@ -556,9 +558,9 @@ class B1 { data class B2(val b1: WorkerBoundReference) -fun createCyclicGarbage(): Triple?>, WeakReference, WeakReference> { +fun createCyclicGarbage(): Triple?>, WeakReference, WeakReference> { val ref1 = WorkerBoundReference(B1()) - val ref1Owner: FreezableAtomicReference?> = FreezableAtomicReference(ref1) + val ref1Owner: AtomicReference?> = AtomicReference(ref1) val ref1Weak = WeakReference(ref1.value) val ref2 = WorkerBoundReference(B2(ref1)) @@ -783,7 +785,7 @@ fun concurrentAccessFrozen() { } } } - workerUnlocker.increment() + workerUnlocker.incrementAndGet() for (future in futures) { val value = future.result diff --git a/kotlin-native/backend.native/tests/runtime/exceptions/custom_hook_unhandled_exception.kt b/kotlin-native/backend.native/tests/runtime/exceptions/custom_hook_unhandled_exception.kt index 4c598c6ea75..3f9f6690aca 100644 --- a/kotlin-native/backend.native/tests/runtime/exceptions/custom_hook_unhandled_exception.kt +++ b/kotlin-native/backend.native/tests/runtime/exceptions/custom_hook_unhandled_exception.kt @@ -5,7 +5,7 @@ @file:OptIn(kotlin.experimental.ExperimentalNativeApi::class, FreezingIsDeprecated::class) import kotlin.test.* - +import kotlin.concurrent.AtomicInt import kotlin.native.concurrent.* fun main() { diff --git a/kotlin-native/backend.native/tests/runtime/memory/stress_gc_allocations.kt b/kotlin-native/backend.native/tests/runtime/memory/stress_gc_allocations.kt index 45bb373d305..3f212acc494 100644 --- a/kotlin-native/backend.native/tests/runtime/memory/stress_gc_allocations.kt +++ b/kotlin-native/backend.native/tests/runtime/memory/stress_gc_allocations.kt @@ -5,7 +5,7 @@ @file:OptIn(kotlin.experimental.ExperimentalNativeApi::class, kotlin.native.runtime.NativeRuntimeApi::class) import kotlin.test.* - +import kotlin.concurrent.AtomicInt import kotlin.native.concurrent.* import kotlin.native.internal.MemoryUsageInfo diff --git a/kotlin-native/backend.native/tests/runtime/workers/lazy4.kt b/kotlin-native/backend.native/tests/runtime/workers/lazy4.kt index 33788adff06..4a2fc9b3aa5 100644 --- a/kotlin-native/backend.native/tests/runtime/workers/lazy4.kt +++ b/kotlin-native/backend.native/tests/runtime/workers/lazy4.kt @@ -7,10 +7,9 @@ package runtime.workers.lazy4 import kotlin.test.* - -import kotlin.native.concurrent.* -import kotlin.concurrent.* import kotlin.concurrent.AtomicInt +import kotlin.concurrent.* +import kotlin.native.concurrent.* const val WORKERS_COUNT = 20 diff --git a/kotlin-native/backend.native/tests/runtime/workers/worker10.kt b/kotlin-native/backend.native/tests/runtime/workers/worker10.kt index 3c38d41193f..4daf225646c 100644 --- a/kotlin-native/backend.native/tests/runtime/workers/worker10.kt +++ b/kotlin-native/backend.native/tests/runtime/workers/worker10.kt @@ -3,11 +3,10 @@ package runtime.workers.worker10 import kotlin.test.* - -import kotlin.native.concurrent.* -import kotlin.concurrent.* -import kotlin.concurrent.AtomicInt import kotlin.concurrent.AtomicReference +import kotlin.concurrent.AtomicInt +import kotlin.concurrent.* +import kotlin.native.concurrent.* import kotlin.native.ref.WeakReference import kotlinx.cinterop.StableRef diff --git a/kotlin-native/backend.native/tests/runtime/workers/worker11.kt b/kotlin-native/backend.native/tests/runtime/workers/worker11.kt index 30542ba008a..b5527c552f0 100644 --- a/kotlin-native/backend.native/tests/runtime/workers/worker11.kt +++ b/kotlin-native/backend.native/tests/runtime/workers/worker11.kt @@ -7,10 +7,9 @@ package runtime.workers.worker11 import kotlin.test.* - -import kotlin.native.concurrent.* -import kotlin.concurrent.* import kotlin.concurrent.AtomicInt +import kotlin.concurrent.* +import kotlin.native.concurrent.* import kotlinx.cinterop.convert data class Job(val index: Int, var input: Int, var counter: Int) diff --git a/kotlin-native/backend.native/tests/runtime/workers/worker4.kt b/kotlin-native/backend.native/tests/runtime/workers/worker4.kt index 956e8aa9af9..e095a32f84c 100644 --- a/kotlin-native/backend.native/tests/runtime/workers/worker4.kt +++ b/kotlin-native/backend.native/tests/runtime/workers/worker4.kt @@ -7,8 +7,8 @@ package runtime.workers.worker4 import kotlin.test.* -import kotlin.native.concurrent.* import kotlin.concurrent.AtomicInt +import kotlin.native.concurrent.* @Test fun runTest1() { withWorker { diff --git a/kotlin-native/runtime/src/main/kotlin/kotlin/concurrent/Atomics.kt b/kotlin-native/runtime/src/main/kotlin/kotlin/concurrent/Atomics.kt index c29357cd735..7130088876f 100644 --- a/kotlin-native/runtime/src/main/kotlin/kotlin/concurrent/Atomics.kt +++ b/kotlin-native/runtime/src/main/kotlin/kotlin/concurrent/Atomics.kt @@ -69,24 +69,6 @@ public class AtomicInt(@Volatile public var value: Int) { */ public fun getAndDecrement(): Int = this::value.getAndAddField(-1) - /** - * Atomically increments the current value by one. - */ - @Deprecated(level = DeprecationLevel.ERROR, message = "Use incrementAndGet() or getAndIncrement() instead.", - replaceWith = ReplaceWith("this.incrementAndGet()")) - public fun increment(): Unit { - addAndGet(1) - } - - /** - * Atomically decrements the current value by one. - */ - @Deprecated(level = DeprecationLevel.ERROR, message = "Use decrementAndGet() or getAndDecrement() instead.", - replaceWith = ReplaceWith("this.decrementAndGet()")) - public fun decrement(): Unit { - addAndGet(-1) - } - /** * Returns the string representation of the current [value]. */ @@ -151,30 +133,6 @@ public class AtomicLong(@Volatile public var value: Long) { */ public fun getAndDecrement(): Long = this::value.getAndAddField(-1L) - /** - * Atomically adds the [given value][delta] to the current value and returns the new value. - */ - @Deprecated(level = DeprecationLevel.ERROR, message = "Use addAndGet(delta: Long) instead.") - public fun addAndGet(delta: Int): Long = addAndGet(delta.toLong()) - - /** - * Atomically increments the current value by one. - */ - @Deprecated(level = DeprecationLevel.ERROR, message = "Use incrementAndGet() or getAndIncrement() instead.", - replaceWith = ReplaceWith("this.incrementAndGet()")) - public fun increment(): Unit { - addAndGet(1L) - } - - /** - * Atomically decrements the current value by one. - */ - @Deprecated(level = DeprecationLevel.ERROR, message = "Use decrementAndGet() or getAndDecrement() instead.", - replaceWith = ReplaceWith("this.decrementAndGet()")) - public fun decrement(): Unit { - addAndGet(-1L) - } - /** * Returns the string representation of the current [value]. */ @@ -184,7 +142,6 @@ public class AtomicLong(@Volatile public var value: Long) { /** * An object reference that is always updated atomically. */ -@OptIn(FreezingIsDeprecated::class) @SinceKotlin("1.9") public class AtomicReference(public @Volatile var value: T) { diff --git a/kotlin-native/runtime/src/main/kotlin/kotlin/native/concurrent/Atomics.kt b/kotlin-native/runtime/src/main/kotlin/kotlin/native/concurrent/Atomics.kt index 9a33c6e880d..f4ff06fe16f 100644 --- a/kotlin-native/runtime/src/main/kotlin/kotlin/native/concurrent/Atomics.kt +++ b/kotlin-native/runtime/src/main/kotlin/kotlin/native/concurrent/Atomics.kt @@ -16,8 +16,7 @@ import kotlin.concurrent.* * An [Int] value that is always updated atomically. * For additional details about atomicity guarantees for reads and writes see [kotlin.concurrent.Volatile]. */ -@Deprecated("Use kotlin.concurrent.AtomicInt instead.", ReplaceWith("kotlin.concurrent.AtomicInt")) -@DeprecatedSinceKotlin(warningSince = "1.9") +@Deprecated("Use kotlin.concurrent.AtomicInt instead.", ReplaceWith("kotlin.concurrent.AtomicInt"), DeprecationLevel.ERROR) public class AtomicInt(public @Volatile var value: Int) { /** * Atomically sets the value to the given [new value][newValue] and returns the old value. @@ -73,7 +72,7 @@ public class AtomicInt(public @Volatile var value: Int) { /** * Atomically increments the current value by one. */ - @Deprecated("Use incrementAndGet() or getAndIncrement() instead.", ReplaceWith("this.incrementAndGet()")) + @Deprecated("Use incrementAndGet() or getAndIncrement() instead.", ReplaceWith("this.incrementAndGet()"), DeprecationLevel.ERROR) public fun increment(): Unit { addAndGet(1) } @@ -81,7 +80,7 @@ public class AtomicInt(public @Volatile var value: Int) { /** * Atomically decrements the current value by one. */ - @Deprecated("Use decrementAndGet() or getAndDecrement() instead.", ReplaceWith("this.decrementAndGet()")) + @Deprecated("Use decrementAndGet() or getAndDecrement() instead.", ReplaceWith("this.decrementAndGet()"), DeprecationLevel.ERROR) public fun decrement(): Unit { addAndGet(-1) } @@ -96,8 +95,7 @@ public class AtomicInt(public @Volatile var value: Int) { * A [Long] value that is always updated atomically. * For additional details about atomicity guarantees for reads and writes see [kotlin.concurrent.Volatile]. */ -@Deprecated("Use kotlin.concurrent.AtomicLong instead.", ReplaceWith("kotlin.concurrent.AtomicLong")) -@DeprecatedSinceKotlin(warningSince = "1.9") +@Deprecated("Use kotlin.concurrent.AtomicLong instead.", ReplaceWith("kotlin.concurrent.AtomicLong"), DeprecationLevel.ERROR) public class AtomicLong(public @Volatile var value: Long = 0L) { /** * Atomically sets the value to the given [new value][newValue] and returns the old value. @@ -153,13 +151,13 @@ public class AtomicLong(public @Volatile var value: Long = 0L) { /** * Atomically adds the [given value][delta] to the current value and returns the new value. */ - @Deprecated("Use addAndGet(delta: Long) instead.") + @Deprecated(message = "Use addAndGet(delta: Long) instead.", level = DeprecationLevel.ERROR) public fun addAndGet(delta: Int): Long = addAndGet(delta.toLong()) /** * Atomically increments the current value by one. */ - @Deprecated("Use incrementAndGet() or getAndIncrement() instead.", ReplaceWith("this.incrementAndGet()")) + @Deprecated("Use incrementAndGet() or getAndIncrement() instead.", ReplaceWith("this.incrementAndGet()"), DeprecationLevel.ERROR) public fun increment(): Unit { addAndGet(1L) } @@ -167,7 +165,7 @@ public class AtomicLong(public @Volatile var value: Long = 0L) { /** * Atomically decrements the current value by one. */ - @Deprecated("Use decrementAndGet() or getAndDecrement() instead.", ReplaceWith("this.decrementAndGet()")) + @Deprecated("Use decrementAndGet() or getAndDecrement() instead.", ReplaceWith("this.decrementAndGet()"), DeprecationLevel.ERROR) fun decrement(): Unit { addAndGet(-1L) } @@ -181,8 +179,7 @@ public class AtomicLong(public @Volatile var value: Long = 0L) { /** * An object reference that is always updated atomically. */ -@Deprecated("Use kotlin.concurrent.AtomicReference instead.", ReplaceWith("kotlin.concurrent.AtomicReference")) -@DeprecatedSinceKotlin(warningSince = "1.9") +@Deprecated("Use kotlin.concurrent.AtomicReference instead.", ReplaceWith("kotlin.concurrent.AtomicReference"), DeprecationLevel.ERROR) public class AtomicReference(public @Volatile var value: T) { /** * Atomically sets the value to the given [new value][newValue] and returns the old value. @@ -223,8 +220,7 @@ public class AtomicReference(public @Volatile var value: T) { * [kotlinx.cinterop.NativePtr] is a value type, hence it is stored in [AtomicNativePtr] without boxing * and [compareAndSet], [compareAndSwap] operations perform comparison by value. */ -@Deprecated("Use kotlin.concurrent.AtomicNativePtr instead.", ReplaceWith("kotlin.concurrent.AtomicNativePtr")) -@DeprecatedSinceKotlin(warningSince = "1.9") +@Deprecated("Use kotlin.concurrent.AtomicNativePtr instead.", ReplaceWith("kotlin.concurrent.AtomicNativePtr"), DeprecationLevel.ERROR) public class AtomicNativePtr(public @Volatile var value: NativePtr) { /** * Atomically sets the value to the given [new value][newValue] and returns the old value. @@ -281,8 +277,7 @@ private fun debugString(value: Any?): String { * This class was useful only with legacy memory manager. Please use [AtomicReference] instead. */ @FreezingIsDeprecated -@Deprecated("Use kotlin.concurrent.AtomicReference instead.", ReplaceWith("kotlin.concurrent.AtomicReference")) -@DeprecatedSinceKotlin(warningSince = "1.9") +@Deprecated("Use kotlin.concurrent.AtomicReference instead.", ReplaceWith("kotlin.concurrent.AtomicReference"), DeprecationLevel.ERROR) public class FreezableAtomicReference(public @Volatile var value: T) { /**