diff options
author | Iulian Dragos <jaguarul@gmail.com> | 2011-01-10 15:43:55 +0000 |
---|---|---|
committer | Iulian Dragos <jaguarul@gmail.com> | 2011-01-10 15:43:55 +0000 |
commit | fe65bb177fb7ceccad2004a7cfd69195b6c3bc3d (patch) | |
tree | b150f52d4ca3d72820a344662fd6deb8036dc2ab /src/compiler/scala/tools/nsc/interactive/CompilerControl.scala | |
parent | 158e748e44932beb477d5bc69a062a6f738efd91 (diff) | |
download | scala-fe65bb177fb7ceccad2004a7cfd69195b6c3bc3d.tar.gz scala-fe65bb177fb7ceccad2004a7cfd69195b6c3bc3d.tar.bz2 scala-fe65bb177fb7ceccad2004a7cfd69195b6c3bc3d.zip |
Moved the presentation compiler thread in its o...
Moved the presentation compiler thread in its own top-level class. This
allows to collect the presentation compiler instance when the thread is
not GCed, but the compiler should be discarded (for example, after a
shutdown request). Having the thread as an inner class keeps a reference
to the outer class. review by odersky.
Diffstat (limited to 'src/compiler/scala/tools/nsc/interactive/CompilerControl.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/interactive/CompilerControl.scala | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/compiler/scala/tools/nsc/interactive/CompilerControl.scala b/src/compiler/scala/tools/nsc/interactive/CompilerControl.scala index 4a4808b28e..16a7b2377a 100644 --- a/src/compiler/scala/tools/nsc/interactive/CompilerControl.scala +++ b/src/compiler/scala/tools/nsc/interactive/CompilerControl.scala @@ -74,7 +74,7 @@ trait CompilerControl { self: Global => /** The scheduler by which client and compiler communicate * Must be initialized before starting compilerRunner */ - protected val scheduler = new WorkScheduler + protected[interactive] val scheduler = new WorkScheduler /** The compilation unit corresponding to a source file * if it does not yet exist creat a new one atomically @@ -177,9 +177,12 @@ trait CompilerControl { self: Global => /** Ask for a computation to be done quickly on the presentation compiler thread */ def ask[A](op: () => A): A = scheduler doQuickly op +} // ---------------- Interpreted exceptions ------------------- - object FreshRunReq extends ControlThrowable - object ShutdownReq extends ControlThrowable -} +/** It has to stay top-level so that the PresentationCompilerThread may access it. */ +object FreshRunReq extends ControlThrowable + +/** It has to stay top-level so that the PresentationCompilerThread may access it. */ +object ShutdownReq extends ControlThrowable |