Make k.c.Volatile since 1.9 in JVM and Common KT-55268, KT-55609

Leave it experimental since 1.8 for K/Native.
This commit is contained in:
Ilya Gorbunov
2022-12-28 02:39:10 +01:00
committed by Space Team
parent f7940a2d46
commit 916f733f73
5 changed files with 7 additions and 2 deletions
@@ -1,5 +1,6 @@
// TARGET_BACKEND: JVM
// !API_VERSION: 1.9
// WITH_STDLIB
// FULL_JDK
@@ -1,3 +1,4 @@
// !API_VERSION: 1.9
@Volatile var vol = 1
@OptIn(ExperimentalStdlibApi::class)
@kotlin.concurrent.Volatile var vol2 = 1
@@ -1,5 +1,6 @@
// FIR_IDENTICAL
// !DIAGNOSTICS: -UNUSED_ANONYMOUS_PARAMETER
// !API_VERSION: 1.9
import kotlin.jvm.Volatile as JvmVolatile
import kotlin.concurrent.Volatile
import kotlin.properties.Delegates
@@ -14,6 +14,7 @@ package kotlin.concurrent
* For example, if the property getter or setter make several operations with the backing field,
* a _property_ operation, i.e. reading or setting it through these accessors, is not guaranteed to be atomic.
*/
@SinceKotlin("1.8")
@Suppress("NEWER_VERSION_IN_SINCE_KOTLIN")
@SinceKotlin("1.9")
@ExperimentalStdlibApi
public actual typealias Volatile = kotlin.jvm.Volatile
@@ -24,7 +24,8 @@ import kotlin.internal.RequireKotlinVersionKind
@Retention(AnnotationRetention.SOURCE)
@MustBeDocumented
@OptionalExpectation
@SinceKotlin("1.8")
@Suppress("NEWER_VERSION_IN_SINCE_KOTLIN")
@SinceKotlin("1.9")
@RequireKotlin(version = "1.8.20", versionKind = RequireKotlinVersionKind.COMPILER_VERSION)
@ExperimentalStdlibApi
public expect annotation class Volatile()