From 65270b6ba69f37cf6338397fa9a678cd3fe5ca3e Mon Sep 17 00:00:00 2001 From: Abduqodiri Qurbonzoda Date: Tue, 18 Feb 2020 01:23:27 +0300 Subject: [PATCH] Mark shared global vals to fix K/N worker thread crash (cherry picked from commit e346f0c5c0fb138cdf4a506e4e7f61234d60d10e) --- runtime/src/main/kotlin/kotlin/text/Strings.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/runtime/src/main/kotlin/kotlin/text/Strings.kt b/runtime/src/main/kotlin/kotlin/text/Strings.kt index e8df0b0a3cf..caa239508fa 100644 --- a/runtime/src/main/kotlin/kotlin/text/Strings.kt +++ b/runtime/src/main/kotlin/kotlin/text/Strings.kt @@ -5,6 +5,8 @@ package kotlin.text +import kotlin.native.concurrent.SharedImmutable + /** * Returns the index within this string of the first occurrence of the specified character, starting from the specified offset. */ @@ -336,6 +338,7 @@ public actual fun String.compareTo(other: String, ignoreCase: Boolean): Int { else compareToIgnoreCase(this, other) } +@SharedImmutable private val STRING_CASE_INSENSITIVE_ORDER = Comparator { a, b -> a.compareTo(b, ignoreCase = true) } public actual val String.Companion.CASE_INSENSITIVE_ORDER: Comparator