diff options
author | Iulian Dragos <jaguarul@gmail.com> | 2012-05-10 15:46:25 +0200 |
---|---|---|
committer | Iulian Dragos <jaguarul@gmail.com> | 2012-05-10 15:46:25 +0200 |
commit | 0d70c22279daa78b3fe58b5ea1be7f87b7079834 (patch) | |
tree | 6e9a79aa074205e353e6073a875dea202ea7f8d4 /src/compiler | |
parent | 58bb2d1bd2000ac3aa2c64b6c5dc56c91e911860 (diff) | |
download | scala-0d70c22279daa78b3fe58b5ea1be7f87b7079834.tar.gz scala-0d70c22279daa78b3fe58b5ea1be7f87b7079834.tar.bz2 scala-0d70c22279daa78b3fe58b5ea1be7f87b7079834.zip |
Don't forget to execute pending interrupt requests when shutting down the presentation compiler.
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/scala/tools/nsc/interactive/Global.scala | 4 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/util/WorkScheduler.scala | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/compiler/scala/tools/nsc/interactive/Global.scala b/src/compiler/scala/tools/nsc/interactive/Global.scala index ec73af4dca..cf80570563 100644 --- a/src/compiler/scala/tools/nsc/interactive/Global.scala +++ b/src/compiler/scala/tools/nsc/interactive/Global.scala @@ -352,6 +352,10 @@ class Global(settings: Settings, _reporter: Reporter, projectName: String = "") case item: WorkItem => Some(item.raiseMissing()) case _ => Some(()) } + + // don't forget to service interrupt requests + val iqs = scheduler.dequeueAllInterrupts(_.execute()) + debugLog("ShutdownReq: cleaning work queue (%d items)".format(units.size)) debugLog("Cleanup up responses (%d loadedType pending, %d parsedEntered pending)" .format(waitLoadedTypeResponses.size, getParsedEnteredResponses.size)) diff --git a/src/compiler/scala/tools/nsc/util/WorkScheduler.scala b/src/compiler/scala/tools/nsc/util/WorkScheduler.scala index 2534e1192d..8c037cbda5 100644 --- a/src/compiler/scala/tools/nsc/util/WorkScheduler.scala +++ b/src/compiler/scala/tools/nsc/util/WorkScheduler.scala @@ -30,6 +30,10 @@ class WorkScheduler { todo.dequeueAll(a => f(a).isDefined).map(a => f(a).get) } + def dequeueAllInterrupts(f: InterruptReq => Unit): Unit = synchronized { + interruptReqs.dequeueAll { iq => f(iq); true } + } + /** Called from server: return optional exception posted by client * Reset to no exception. */ |