[FIR-IDE] Add lock for status resolve
This commit is contained in:
+8
-1
@@ -14,12 +14,16 @@ import kotlin.concurrent.withLock
|
||||
|
||||
internal class FirPhaseRunner(val transformerProvider: FirTransformerProvider) {
|
||||
private val superTypesBodyResolveLock = ReentrantLock()
|
||||
private val statusResolveLock = ReentrantLock()
|
||||
private val implicitTypesResolveLock = ReentrantLock()
|
||||
|
||||
fun runPhase(firFile: FirFile, phase: FirResolvePhase) = when (phase) {
|
||||
FirResolvePhase.SUPER_TYPES -> superTypesBodyResolveLock.withLock {
|
||||
runPhaseWithoutLock(firFile, phase)
|
||||
}
|
||||
FirResolvePhase.STATUS -> statusResolveLock.withLock {
|
||||
runPhaseWithoutLock(firFile, phase)
|
||||
}
|
||||
FirResolvePhase.IMPLICIT_TYPES_BODY_RESOLVE -> implicitTypesResolveLock.withLock {
|
||||
runPhaseWithoutLock(firFile, phase)
|
||||
}
|
||||
@@ -32,6 +36,9 @@ internal class FirPhaseRunner(val transformerProvider: FirTransformerProvider) {
|
||||
FirResolvePhase.SUPER_TYPES -> superTypesBodyResolveLock.withLock {
|
||||
runPhaseWithCustomResolveWithoutLock(resolve)
|
||||
}
|
||||
FirResolvePhase.STATUS -> statusResolveLock.withLock {
|
||||
runPhaseWithCustomResolveWithoutLock(resolve)
|
||||
}
|
||||
FirResolvePhase.IMPLICIT_TYPES_BODY_RESOLVE -> implicitTypesResolveLock.withLock {
|
||||
runPhaseWithCustomResolveWithoutLock(resolve)
|
||||
}
|
||||
@@ -54,4 +61,4 @@ internal class FirPhaseRunner(val transformerProvider: FirTransformerProvider) {
|
||||
phaseProcessor.processFile(firFile)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user