summaryrefslogtreecommitdiff
path: root/src/interactive
diff options
context:
space:
mode:
authorGrzegorz Kossakowski <grzegorz.kossakowski@gmail.com>2014-02-10 20:46:14 +0100
committerGrzegorz Kossakowski <grzegorz.kossakowski@gmail.com>2014-02-10 20:46:14 +0100
commitc611f7b91414831e4de86e07c6310865b075b98d (patch)
tree8f2412d785281c144632aaf7b58eaa1d4edd71a8 /src/interactive
parent90aa12ee9cca5d433459f0a825d510c8fb1c17be (diff)
parent894aee1347600201dd2decbd07bcf7820cbbee3d (diff)
downloadscala-c611f7b91414831e4de86e07c6310865b075b98d.tar.gz
scala-c611f7b91414831e4de86e07c6310865b075b98d.tar.bz2
scala-c611f7b91414831e4de86e07c6310865b075b98d.zip
Merge pull request #3502 from retronym/ticket/8258
Fix regression for using Scala IDE on scala-library
Diffstat (limited to 'src/interactive')
-rw-r--r--src/interactive/scala/tools/nsc/interactive/Global.scala15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/interactive/scala/tools/nsc/interactive/Global.scala b/src/interactive/scala/tools/nsc/interactive/Global.scala
index 279b841714..95027a26b1 100644
--- a/src/interactive/scala/tools/nsc/interactive/Global.scala
+++ b/src/interactive/scala/tools/nsc/interactive/Global.scala
@@ -534,7 +534,6 @@ class Global(settings: Settings, _reporter: Reporter, projectName: String = "")
threadId += 1
compileRunner = new PresentationCompilerThread(this, projectName)
compileRunner.setDaemon(true)
- compileRunner.start()
compileRunner
}
@@ -1253,11 +1252,21 @@ class Global(settings: Settings, _reporter: Reporter, projectName: String = "")
forceSymbolsUsedByParser()
+ /** Start the compiler background thread and turn on thread confinement checks */
+ private def finishInitialization(): Unit = {
+ // this flag turns on `assertCorrectThread checks`
+ initializing = false
+
+ // Only start the thread if initialization was successful. A crash while forcing symbols (for example
+ // if the Scala library is not on the classpath) can leave running threads behind. See Scala IDE #1002016
+ compileRunner.start()
+ }
+
/** The compiler has been initialized. Constructors are evaluated in textual order,
- * so this is set to true only after all super constructors and the primary constructor
+ * if we reached here, all super constructors and the primary constructor
* have been executed.
*/
- initializing = false
+ finishInitialization()
}
object CancelException extends Exception