summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/compiler/scala/tools/nsc/interactive/Global.scala4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/interactive/Global.scala b/src/compiler/scala/tools/nsc/interactive/Global.scala
index 649193cffb..808fc85356 100644
--- a/src/compiler/scala/tools/nsc/interactive/Global.scala
+++ b/src/compiler/scala/tools/nsc/interactive/Global.scala
@@ -413,7 +413,9 @@ self =>
def reload(sources: List[SourceFile], response: Response[Unit]) {
informIDE("reload" + sources)
respond(response)(reloadSources(sources))
- if (outOfDate) throw FreshRunReq // cancel background compile
+ if (outOfDate)
+ if (activeLocks == 0) throw FreshRunReq // cancel background compile
+ else scheduler.raise(FreshRunReq) // cancel background compile on the next poll
else outOfDate = true // proceed normally and enable new background compile
}