summaryrefslogtreecommitdiff
path: root/src/library
diff options
context:
space:
mode:
Diffstat (limited to 'src/library')
-rw-r--r--src/library/scala/concurrent/Future.scala14
-rw-r--r--src/library/scala/concurrent/package.scala2
2 files changed, 10 insertions, 6 deletions
diff --git a/src/library/scala/concurrent/Future.scala b/src/library/scala/concurrent/Future.scala
index 9937d43b23..36126056c9 100644
--- a/src/library/scala/concurrent/Future.scala
+++ b/src/library/scala/concurrent/Future.scala
@@ -161,11 +161,15 @@ self =>
}
this
}
- def await(timeout: Timeout)(implicit canblock: CanBlock) = try {
- val res = self.await(timeout)
- throw noSuchElem(res)
- } catch {
- case t: Throwable => t
+ def await(timeout: Timeout)(implicit canblock: CanBlock): Throwable = {
+ var t: Throwable = null
+ try {
+ val res = self.await(timeout)
+ t = noSuchElem(res)
+ } catch {
+ case t: Throwable => return t
+ }
+ throw t
}
private def noSuchElem(v: T) =
new NoSuchElementException("Future.failed not completed with a throwable. Instead completed with: " + v)
diff --git a/src/library/scala/concurrent/package.scala b/src/library/scala/concurrent/package.scala
index d9923d6d56..0cdb52fb69 100644
--- a/src/library/scala/concurrent/package.scala
+++ b/src/library/scala/concurrent/package.scala
@@ -33,7 +33,7 @@ package object concurrent {
*/
lazy val scheduler =
new default.SchedulerImpl
-
+
private[concurrent] def currentExecutionContext: ThreadLocal[ExecutionContext] = new ThreadLocal[ExecutionContext] {
override protected def initialValue = null
}