summaryrefslogtreecommitdiff
path: root/src/interactive
diff options
context:
space:
mode:
authorFrançois Garillot <francois@garillot.net>2013-09-20 13:51:49 +0200
committerFrançois Garillot <francois@garillot.net>2013-09-20 14:02:53 +0200
commitf8e28af5c5c081f1c0145f320b683f8278cafdd6 (patch)
treefe2fe911127c7de399bf8668ad27619513ac70d6 /src/interactive
parent33a819f61b8b9c19708e8ae22bf25adf6cc7ac24 (diff)
downloadscala-f8e28af5c5c081f1c0145f320b683f8278cafdd6.tar.gz
scala-f8e28af5c5c081f1c0145f320b683f8278cafdd6.tar.bz2
scala-f8e28af5c5c081f1c0145f320b683f8278cafdd6.zip
Follow good interrupt discipline in Response
Restores the interrupted status of the waiting thread after catching an InterruptException.
Diffstat (limited to 'src/interactive')
-rw-r--r--src/interactive/scala/tools/nsc/interactive/Response.scala10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/interactive/scala/tools/nsc/interactive/Response.scala b/src/interactive/scala/tools/nsc/interactive/Response.scala
index f36f769ec9..ea0a23fec9 100644
--- a/src/interactive/scala/tools/nsc/interactive/Response.scala
+++ b/src/interactive/scala/tools/nsc/interactive/Response.scala
@@ -55,7 +55,10 @@ class Response[T] {
try {
wait()
} catch {
- case exc: InterruptedException => raise(exc)
+ case exc: InterruptedException => {
+ Thread.currentThread().interrupt()
+ raise(exc)
+ }
}
}
data.get
@@ -73,7 +76,10 @@ class Response[T] {
try {
wait(timeout - (current - start))
} catch {
- case exc: InterruptedException => raise(exc)
+ case exc: InterruptedException => {
+ Thread.currentThread().interrupt()
+ raise(exc)
+ }
}
current = System.currentTimeMillis
}