summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Vigdorchik <eugenevigdorchik@epfl.ch>2010-11-02 14:13:54 +0000
committerEugene Vigdorchik <eugenevigdorchik@epfl.ch>2010-11-02 14:13:54 +0000
commit543d70e30c153522eedb986755ae3a5de8d820c6 (patch)
tree35ee71602181404a2e049bb3caa22fd4401046a9
parent6fddcaa5f9eb15beeb25d27c773093796c78ca0b (diff)
downloadscala-543d70e30c153522eedb986755ae3a5de8d820c6.tar.gz
scala-543d70e30c153522eedb986755ae3a5de8d820c6.tar.bz2
scala-543d70e30c153522eedb986755ae3a5de8d820c6.zip
Make compile runner thread volatile + remove a ...
Make compile runner thread volatile + remove a race condition. Review by odersky.
-rw-r--r--src/compiler/scala/tools/nsc/interactive/Global.scala5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/interactive/Global.scala b/src/compiler/scala/tools/nsc/interactive/Global.scala
index e3363eb745..dedd79f634 100644
--- a/src/compiler/scala/tools/nsc/interactive/Global.scala
+++ b/src/compiler/scala/tools/nsc/interactive/Global.scala
@@ -212,7 +212,8 @@ self =>
// ----------------- The Background Runner Thread -----------------------
/** The current presentation compiler runner */
- protected var compileRunner = newRunnerThread
+ @volatile protected var compileRunner = newRunnerThread
+ compileRunner.start()
private var threadId = 1
@@ -239,6 +240,7 @@ self =>
case ex =>
outOfDate = false
compileRunner = newRunnerThread
+ compileRunner.start()
ex match {
case FreshRunReq => // This shouldn't be reported
case _ : ValidateException => // This will have been reported elsewhere
@@ -247,7 +249,6 @@ self =>
}
}
threadId += 1
- start()
}
/** Compile all given units