diff options
author | Eugene Burmako <xeno.by@gmail.com> | 2013-01-26 17:11:13 +0100 |
---|---|---|
committer | Eugene Burmako <xeno.by@gmail.com> | 2013-10-18 17:48:51 +0200 |
commit | efdcb3c837c8fac0c90be7f794a379c4b808147b (patch) | |
tree | 202850fc5819e7b04451c87fe2e0906b2e40c2c6 /src | |
parent | 544ae248aabaf919294f2aa375ebbd92b1c8757d (diff) | |
download | scala-efdcb3c837c8fac0c90be7f794a379c4b808147b.tar.gz scala-efdcb3c837c8fac0c90be7f794a379c4b808147b.tar.bz2 scala-efdcb3c837c8fac0c90be7f794a379c4b808147b.zip |
synchronizes toolboxes
We don't guarantee thread-safety of the front end, but everything else
looks good now.
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/reflect/ToolBoxFactory.scala | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/reflect/ToolBoxFactory.scala b/src/compiler/scala/tools/reflect/ToolBoxFactory.scala index fdc2613810..09f795a840 100644 --- a/src/compiler/scala/tools/reflect/ToolBoxFactory.scala +++ b/src/compiler/scala/tools/reflect/ToolBoxFactory.scala @@ -340,7 +340,8 @@ abstract class ToolBoxFactory[U <: JavaUniverse](val u: U) { factorySelf => lazy val exporter = importer.reverse } - def apply[T](f: CompilerApi => T): T = { + private val toolBoxLock = new Object + def apply[T](f: CompilerApi => T): T = toolBoxLock.synchronized { try f(api) catch { case ex: FatalError => throw ToolBoxError(s"fatal compiler error", ex) } finally api.compiler.cleanupCaches() |