From 5a81ac3ba585cbc4655fe7a66280e4a02314c08b Mon Sep 17 00:00:00 2001 From: Viktor Klang Date: Fri, 20 Jul 2012 16:01:18 +0200 Subject: [PATCH] Bumpting to Scala 2.10.0-SNAPSHOT --- .../src/main/scala/akka/dispatch/ThreadPoolBuilder.scala | 8 +++----- .../scala/scala/concurrent/impl/InternalFutureUtil.scala | 7 ------- project/AkkaBuild.scala | 8 ++++---- 3 files changed, 7 insertions(+), 16 deletions(-) delete mode 100644 akka-actor/src/main/scala/scala/concurrent/impl/InternalFutureUtil.scala diff --git a/akka-actor/src/main/scala/akka/dispatch/ThreadPoolBuilder.scala b/akka-actor/src/main/scala/akka/dispatch/ThreadPoolBuilder.scala index 20fae75ef1..2d38128abe 100644 --- a/akka-actor/src/main/scala/akka/dispatch/ThreadPoolBuilder.scala +++ b/akka-actor/src/main/scala/akka/dispatch/ThreadPoolBuilder.scala @@ -5,7 +5,7 @@ package akka.dispatch import java.util.Collection -import scala.concurrent.{ Awaitable, BlockContext } +import scala.concurrent.{ Awaitable, BlockContext, CanAwait } import scala.concurrent.util.Duration import scala.concurrent.forkjoin._ import java.util.concurrent.{ @@ -159,13 +159,11 @@ object MonitorableThreadFactory { new Thread.UncaughtExceptionHandler() { def uncaughtException(thread: Thread, cause: Throwable) = () } private[akka] class AkkaForkJoinWorkerThread(_pool: ForkJoinPool) extends ForkJoinWorkerThread(_pool) with BlockContext { - override def internalBlockingCall[T](awaitable: Awaitable[T], atMost: Duration): T = { + override def blockOn[T](thunk: ⇒ T)(implicit permission: CanAwait): T = { val result = new AtomicReference[Option[T]](None) ForkJoinPool.managedBlock(new ForkJoinPool.ManagedBlocker { def block(): Boolean = { - result.set(Some(awaitable.result(atMost)(scala.concurrent.impl.InternalFutureUtil.canAwaitEvidence))) - // FIXME replace with - //result.set(Some(BlockContext.DefaultBlockContext.internalBlockingCall(awaitable, atMost))) + result.set(Some(thunk)) true } def isReleasable = result.get.isDefined diff --git a/akka-actor/src/main/scala/scala/concurrent/impl/InternalFutureUtil.scala b/akka-actor/src/main/scala/scala/concurrent/impl/InternalFutureUtil.scala deleted file mode 100644 index 6d2653c559..0000000000 --- a/akka-actor/src/main/scala/scala/concurrent/impl/InternalFutureUtil.scala +++ /dev/null @@ -1,7 +0,0 @@ -package scala.concurrent.impl - -import scala.concurrent.ExecutionContext - -object InternalFutureUtil { - @inline final def canAwaitEvidence = scala.concurrent.Await.canAwaitEvidence -} \ No newline at end of file diff --git a/project/AkkaBuild.scala b/project/AkkaBuild.scala index 9eeae87485..aa02d4dec4 100644 --- a/project/AkkaBuild.scala +++ b/project/AkkaBuild.scala @@ -25,12 +25,12 @@ object AkkaBuild extends Build { lazy val buildSettings = Seq( organization := "com.typesafe.akka", version := "2.1-SNAPSHOT", - scalaVersion := desiredScalaVersion - /*scalaVersion := "2.10.0-SNAPSHOT", + //scalaVersion := desiredScalaVersion + scalaVersion := "2.10.0-SNAPSHOT", scalaVersion in update <<= (scalaVersion) apply { case "2.10.0-SNAPSHOT" => desiredScalaVersion case x => x - }*/ + } ) lazy val akka = Project( @@ -47,7 +47,7 @@ object AkkaBuild extends Build { """|import akka.actor._ |import akka.dispatch._ |import com.typesafe.config.ConfigFactory - |import akka.util.duration._ + |import scala.concurrent.util.duration._ |import akka.util.Timeout |val config = ConfigFactory.parseString("akka.stdout-loglevel=INFO,akka.loglevel=DEBUG") |val remoteConfig = ConfigFactory.parseString("akka.remote.netty{port=0,use-dispatcher-for-io=akka.actor.default-dispatcher,execution-pool-size=0},akka.actor.provider=RemoteActorRefProvider").withFallback(config)