summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/util/InterruptReq.scala
diff options
context:
space:
mode:
authorIulian Dragos <jaguarul@gmail.com>2012-10-10 11:28:00 +0200
committerIulian Dragos <jaguarul@gmail.com>2012-10-10 11:28:00 +0200
commit19ea47b3425f973c1ca92890cb8ee561b0ecab3d (patch)
tree76c0570c87706efabb659b2fb70f040c50135cc6 /src/compiler/scala/tools/nsc/util/InterruptReq.scala
parent859ec02495993f225647df50397b042a3172351b (diff)
downloadscala-19ea47b3425f973c1ca92890cb8ee561b0ecab3d.tar.gz
scala-19ea47b3425f973c1ca92890cb8ee561b0ecab3d.tar.bz2
scala-19ea47b3425f973c1ca92890cb8ee561b0ecab3d.zip
Fixed SI-6505. Respond to ask calls by immediate failure even after compiler shutdown.
When the compiler is asked to shutdown, it may still have items on the working queue, and more can be added by clients in other thread that don't *know* the compiler is down yet. These requests were never serviced, leading to deadlocks or timeouts. review by @odersky, @hubertp
Diffstat (limited to 'src/compiler/scala/tools/nsc/util/InterruptReq.scala')
-rw-r--r--src/compiler/scala/tools/nsc/util/InterruptReq.scala5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/util/InterruptReq.scala b/src/compiler/scala/tools/nsc/util/InterruptReq.scala
index 816d16f767..b1b81d0952 100644
--- a/src/compiler/scala/tools/nsc/util/InterruptReq.scala
+++ b/src/compiler/scala/tools/nsc/util/InterruptReq.scala
@@ -47,7 +47,10 @@ abstract class InterruptReq {
}
def onComplete(k: Continuation) = synchronized {
- waiting = k :: waiting
+ if (result.isDefined)
+ k(result.get)
+ else
+ waiting = k :: waiting
}
}