diff options
-rw-r--r-- | src/actors/scala/actors/Actor.scala | 31 |
1 files changed, 13 insertions, 18 deletions
diff --git a/src/actors/scala/actors/Actor.scala b/src/actors/scala/actors/Actor.scala index fb2978ec9f..2e0d0185d5 100644 --- a/src/actors/scala/actors/Actor.scala +++ b/src/actors/scala/actors/Actor.scala @@ -472,8 +472,6 @@ trait Actor extends OutputChannel[Any] { private[actors] var kill = () => {} - private class ExitSuspendLoop extends Throwable - def suspendActor() { isWaiting = true while(isWaiting) { @@ -492,24 +490,21 @@ trait Actor extends OutputChannel[Any] { var waittime = msec var fromExc = false isWaiting = true - - try { - while(isWaiting) { - try { - fromExc = false - wait(waittime) - } catch { - case _: InterruptedException => { - fromExc = true - val now = Platform.currentTime - val waited = now-ts - waittime = msec-waited - if (waittime < 0) { isWaiting = false } - } + while(isWaiting) { + try { + fromExc = false + wait(waittime) + } catch { + case _: InterruptedException => { + fromExc = true + val now = Platform.currentTime + val waited = now-ts + waittime = msec-waited + if (waittime < 0) { isWaiting = false } } - if (!fromExc) throw new ExitSuspendLoop } - } catch { case _: ExitSuspendLoop => } + if (!fromExc) { isWaiting = false } + } // links: check if we should exit if (shouldExit) exit() } |