From 348fd6e69ae96b5d8187e1f25372c0908a5ce218 Mon Sep 17 00:00:00 2001 From: Philipp Haller Date: Mon, 21 Dec 2009 16:03:07 +0000 Subject: closed #2829. review by rompf. --- src/actors/scala/actors/Future.scala | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/actors') diff --git a/src/actors/scala/actors/Future.scala b/src/actors/scala/actors/Future.scala index ea0c3a691f..70bcde9380 100644 --- a/src/actors/scala/actors/Future.scala +++ b/src/actors/scala/actors/Future.scala @@ -110,12 +110,6 @@ object Futures { * is negative. */ def awaitAll(timeout: Long, fts: Future[Any]*): List[Option[Any]] = { - val thisActor = Actor.self - val timerTask = new java.util.TimerTask { - def run() { thisActor ! TIMEOUT } - } - Actor.timer.schedule(timerTask, timeout) - var resultsMap: collection.mutable.Map[Int, Option[Any]] = new collection.mutable.HashMap[Int, Option[Any]] var cnt = 0 @@ -135,6 +129,12 @@ object Futures { singleCase }) + val thisActor = Actor.self + val timerTask = new java.util.TimerTask { + def run() { thisActor ! TIMEOUT } + } + Actor.timer.schedule(timerTask, timeout) + def awaitWith(partFuns: Seq[PartialFunction[Any, Pair[Int, Any]]]) { val reaction: PartialFunction[Any, Unit] = new PartialFunction[Any, Unit] { def isDefinedAt(msg: Any) = msg match { -- cgit v1.2.3