Fix KT-26455 and KT-26443. (#1970)
This commit is contained in:
@@ -18,4 +18,5 @@ public annotation class Volatile
|
||||
public annotation class Synchronized
|
||||
|
||||
@kotlin.internal.InlineOnly
|
||||
public actual inline fun <R> synchronized(@Suppress("UNUSED_PARAMETER") lock: Any, block: () -> R): R = block()
|
||||
public actual inline fun <R> synchronized(@Suppress("UNUSED_PARAMETER") lock: Any, block: () -> R): R =
|
||||
throw UnsupportedOperationException("synchronized() is unsupported")
|
||||
@@ -68,7 +68,13 @@ internal fun ThrowFreezingException(toFreeze: Any, blocker: Any): Nothing =
|
||||
throw FreezingException(toFreeze, blocker)
|
||||
|
||||
@ExportForCppRuntime
|
||||
internal fun ThrowInvalidMutabilityException(where: Any): Nothing = throw InvalidMutabilityException(where)
|
||||
internal fun ThrowInvalidMutabilityException(where: Any): Nothing {
|
||||
val kClass = where::class
|
||||
val className = kClass.qualifiedName ?: kClass.simpleName ?: "<object>"
|
||||
val unsignedHashCode = where.hashCode().toLong() and 0xffffffffL
|
||||
val hashCodeStr = unsignedHashCode.toString(16)
|
||||
throw InvalidMutabilityException("$className@$hashCodeStr")
|
||||
}
|
||||
|
||||
@SymbolName("Kotlin_AtomicReference_checkIfFrozen")
|
||||
external internal fun checkIfFrozen(ref: Any?)
|
||||
|
||||
Reference in New Issue
Block a user