diff options
author | François Garillot <francois@garillot.net> | 2013-09-20 13:51:49 +0200 |
---|---|---|
committer | François Garillot <francois@garillot.net> | 2013-09-20 14:02:53 +0200 |
commit | f8e28af5c5c081f1c0145f320b683f8278cafdd6 (patch) | |
tree | fe2fe911127c7de399bf8668ad27619513ac70d6 | |
parent | 33a819f61b8b9c19708e8ae22bf25adf6cc7ac24 (diff) | |
download | scala-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.
-rw-r--r-- | src/interactive/scala/tools/nsc/interactive/Response.scala | 10 |
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 } |