[LL FIR] LLFirLockProvider: add registry key to disable global phase lock
It is enabled by default ^KT-56551
This commit is contained in:
committed by
Space Team
parent
53c4a10817
commit
92fc3ec824
+7
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
* Copyright 2010-2024 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -42,6 +42,8 @@ internal class LLFirLockProvider(private val checker: LLFirLazyResolveContractCh
|
|||||||
phase: FirResolvePhase,
|
phase: FirResolvePhase,
|
||||||
action: () -> Unit,
|
action: () -> Unit,
|
||||||
) {
|
) {
|
||||||
|
if (!implicitPhaseLockEnabled) return action()
|
||||||
|
|
||||||
val lock = when (phase) {
|
val lock = when (phase) {
|
||||||
FirResolvePhase.IMPLICIT_TYPES_BODY_RESOLVE -> implicitTypesLock
|
FirResolvePhase.IMPLICIT_TYPES_BODY_RESOLVE -> implicitTypesLock
|
||||||
else -> null
|
else -> null
|
||||||
@@ -237,4 +239,8 @@ private val globalLockEnabled: Boolean by lazy(LazyThreadSafetyMode.PUBLICATION)
|
|||||||
Registry.`is`("kotlin.parallel.resolve.under.global.lock", false)
|
Registry.`is`("kotlin.parallel.resolve.under.global.lock", false)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private val implicitPhaseLockEnabled: Boolean by lazy(LazyThreadSafetyMode.PUBLICATION) {
|
||||||
|
Registry.`is`("kotlin.implicit.resolve.phase.under.global.lock", true)
|
||||||
|
}
|
||||||
|
|
||||||
private const val DEFAULT_LOCKING_INTERVAL = 50L
|
private const val DEFAULT_LOCKING_INTERVAL = 50L
|
||||||
Reference in New Issue
Block a user