Permalink
Browse files

Don't forget to execute pending interrupt requests when shutting down…

… the presentation compiler.(cherry picked from commit 0d70c22)
  • Loading branch information...
1 parent 6891caa commit 38f114f5537f69fe63cc94ab3b64957524c0b79e @dragos dragos committed May 10, 2012
@@ -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))
@@ -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.
*/

0 comments on commit 38f114f

Please sign in to comment.