From a6b2e34c55d1ee77d87bedb7d6ddac3b61f24947 Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Tue, 16 Feb 2010 21:03:43 +0000 Subject: Trying again to unbreak the repl patch. --- src/compiler/scala/tools/nsc/Interpreter.scala | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/compiler') diff --git a/src/compiler/scala/tools/nsc/Interpreter.scala b/src/compiler/scala/tools/nsc/Interpreter.scala index 551f7e1b40..3b6b7a1a7f 100644 --- a/src/compiler/scala/tools/nsc/Interpreter.scala +++ b/src/compiler/scala/tools/nsc/Interpreter.scala @@ -118,14 +118,15 @@ class Interpreter(val settings: Settings, out: PrintWriter) { // set up initialization future private var _isInitialized: () => Boolean = () => false - def initialize() { + def initialize() = synchronized { if (!_isInitialized()) _isInitialized = scala.concurrent.ops future _initialize() } /** the public, go through the future compiler */ lazy val compiler: Global = { - _isInitialized() // blocks until it is + initialize() + _isInitialized() // blocks until it is _compiler } -- cgit v1.2.3