From f8e28af5c5c081f1c0145f320b683f8278cafdd6 Mon Sep 17 00:00:00 2001 From: François Garillot Date: Fri, 20 Sep 2013 13:51:49 +0200 Subject: Follow good interrupt discipline in Response Restores the interrupted status of the waiting thread after catching an InterruptException. --- src/interactive/scala/tools/nsc/interactive/Response.scala | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src') 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 } -- cgit v1.2.3