summaryrefslogtreecommitdiff
path: root/src/library
diff options
context:
space:
mode:
authorphaller <hallerp@gmail.com>2012-07-19 16:53:21 +0200
committerphaller <hallerp@gmail.com>2012-07-19 16:56:48 +0200
commita6aaee845174c3102d4602d16dab9fd673bf4f77 (patch)
tree26cbcb95d17c62c79011ac73361e7f830f6605bf /src/library
parentfaf0f3de05e79af3fd7b5cf3bc3f97331e25042e (diff)
downloadscala-a6aaee845174c3102d4602d16dab9fd673bf4f77.tar.gz
scala-a6aaee845174c3102d4602d16dab9fd673bf4f77.tar.bz2
scala-a6aaee845174c3102d4602d16dab9fd673bf4f77.zip
Clean ups in impl.Future
Diffstat (limited to 'src/library')
-rw-r--r--src/library/scala/concurrent/impl/Future.scala15
-rw-r--r--src/library/scala/concurrent/impl/Promise.scala2
2 files changed, 4 insertions, 13 deletions
diff --git a/src/library/scala/concurrent/impl/Future.scala b/src/library/scala/concurrent/impl/Future.scala
index b32824c0c9..098008e958 100644
--- a/src/library/scala/concurrent/impl/Future.scala
+++ b/src/library/scala/concurrent/impl/Future.scala
@@ -10,22 +10,13 @@ package scala.concurrent.impl
-import scala.concurrent.util.Duration
-import scala.concurrent.{Awaitable, ExecutionContext, CanAwait}
-import scala.collection.mutable.Stack
+import scala.concurrent.ExecutionContext
import scala.util.control.NonFatal
-private[concurrent] trait Future[+T] extends scala.concurrent.Future[T] with Awaitable[T] {
-
-}
private[concurrent] object Future {
-
- def boxedType(c: Class[_]): Class[_] = if (c.isPrimitive) scala.concurrent.Future.toBoxed(c) else c
-
- private[impl] class PromiseCompletingRunnable[T](body: => T)
- extends Runnable {
+ class PromiseCompletingRunnable[T](body: => T) extends Runnable {
val promise = new Promise.DefaultPromise[T]()
override def run() = {
@@ -35,7 +26,7 @@ private[concurrent] object Future {
}
}
- def apply[T](body: =>T)(implicit executor: ExecutionContext): Future[T] = {
+ def apply[T](body: =>T)(implicit executor: ExecutionContext): scala.concurrent.Future[T] = {
val runnable = new PromiseCompletingRunnable(body)
executor.execute(runnable)
runnable.promise.future
diff --git a/src/library/scala/concurrent/impl/Promise.scala b/src/library/scala/concurrent/impl/Promise.scala
index 84638586cf..c2df9ac296 100644
--- a/src/library/scala/concurrent/impl/Promise.scala
+++ b/src/library/scala/concurrent/impl/Promise.scala
@@ -18,7 +18,7 @@ import scala.util.control.NonFatal
-private[concurrent] trait Promise[T] extends scala.concurrent.Promise[T] with Future[T] {
+private[concurrent] trait Promise[T] extends scala.concurrent.Promise[T] with scala.concurrent.Future[T] {
def future: this.type = this
}