summaryrefslogtreecommitdiff
path: root/src/library
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2013-09-27 09:04:30 +0200
committerJason Zaugg <jzaugg@gmail.com>2013-09-27 09:04:30 +0200
commit7fe9a7c34bd424029b5727b1521458d848578449 (patch)
treecf1d2abc8b4e8d5a8eb631954b9024db3c3e4571 /src/library
parent0aaf59149871f817a67c1fefcc3b0457fcb5e4fc (diff)
parent9f62900145029786457f27c1fe3083cde5d83fe2 (diff)
downloadscala-7fe9a7c34bd424029b5727b1521458d848578449.tar.gz
scala-7fe9a7c34bd424029b5727b1521458d848578449.tar.bz2
scala-7fe9a7c34bd424029b5727b1521458d848578449.zip
Merge remote-tracking branch 'origin/2.10.x' into merge/2.10.x-to-master-2
Conflicts: bincompat-backward.whitelist.conf bincompat-forward.whitelist.conf build.xml src/compiler/scala/tools/nsc/typechecker/RefChecks.scala src/library/scala/concurrent/Future.scala src/reflect/scala/reflect/internal/Types.scala
Diffstat (limited to 'src/library')
-rw-r--r--src/library/scala/concurrent/Future.scala11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/library/scala/concurrent/Future.scala b/src/library/scala/concurrent/Future.scala
index 4e3f3c6c81..b9f73c2872 100644
--- a/src/library/scala/concurrent/Future.scala
+++ b/src/library/scala/concurrent/Future.scala
@@ -96,11 +96,8 @@ trait Future[+T] extends Awaitable[T] {
// of the Future trait. Note that this will
// (modulo bugs) _never_ execute a callback
// other than those below in this same file.
- // As a nice side benefit, having this implicit
- // here forces an ambiguity in those methods
- // that also have an executor parameter, which
- // keeps us from accidentally forgetting to use
- // the executor parameter.
+ //
+ // See the documentation on `InternalCallbackExecutor` for more details.
private def internalExecutor = Future.InternalCallbackExecutor
/* Callbacks */
@@ -254,7 +251,7 @@ trait Future[+T] extends Awaitable[T] {
case Success(v) => try f(v) match {
// If possible, link DefaultPromises to avoid space leaks
case dp: DefaultPromise[_] => dp.asInstanceOf[DefaultPromise[S]].linkRootOf(p)
- case fut => fut onComplete p.complete
+ case fut => fut.onComplete(p.complete)(internalExecutor)
} catch { case NonFatal(t) => p failure t }
}
p.future
@@ -344,7 +341,7 @@ trait Future[+T] extends Awaitable[T] {
def recoverWith[U >: T](pf: PartialFunction[Throwable, Future[U]])(implicit executor: ExecutionContext): Future[U] = {
val p = Promise[U]()
onComplete {
- case Failure(t) => try pf.applyOrElse(t, (_: Throwable) => this) onComplete p.complete catch { case NonFatal(t) => p failure t }
+ case Failure(t) => try pf.applyOrElse(t, (_: Throwable) => this).onComplete(p.complete)(internalExecutor) catch { case NonFatal(t) => p failure t }
case other => p complete other
}
p.future