diff --git a/compiler/src/dotty/tools/backend/jvm/GenBCode.scala b/compiler/src/dotty/tools/backend/jvm/GenBCode.scala index d5c111259f01..8d467529d60e 100644 --- a/compiler/src/dotty/tools/backend/jvm/GenBCode.scala +++ b/compiler/src/dotty/tools/backend/jvm/GenBCode.scala @@ -75,7 +75,7 @@ class GenBCode extends Phase { self => } override def run(using Context): Unit = - frontendAccess.frontendSynch { + frontendAccess.frontendSynchWithoutContext { backendInterface.ctx .asInstanceOf[FreshContext] .setCompilationUnit(ctx.compilationUnit) diff --git a/compiler/src/dotty/tools/backend/jvm/PostProcessorFrontendAccess.scala b/compiler/src/dotty/tools/backend/jvm/PostProcessorFrontendAccess.scala index 43b2f1174a5d..f7955cbb350c 100644 --- a/compiler/src/dotty/tools/backend/jvm/PostProcessorFrontendAccess.scala +++ b/compiler/src/dotty/tools/backend/jvm/PostProcessorFrontendAccess.scala @@ -27,6 +27,7 @@ sealed abstract class PostProcessorFrontendAccess(backendInterface: DottyBackend private val frontendLock: AnyRef = new Object() inline final def frontendSynch[T](inline x: Context ?=> T): T = frontendLock.synchronized(x(using backendInterface.ctx)) + inline final def frontendSynchWithoutContext[T](inline x: T): T = frontendLock.synchronized(x) inline def perRunLazy[T](inline init: Context ?=> T): Lazy[T] = new Lazy(init)(using this) }