Throw an exception if Future.await is called on an expired and uncompleted Future. Ref #659

This commit is contained in:
Derek Williams 2011-02-11 15:12:35 -07:00
parent db79e2bd62
commit b625b56ee3

View file

@ -224,6 +224,8 @@ class DefaultCompletableFuture[T](timeout: Long) extends CompletableFuture[T] {
wait = wait - (currentTimeInNanos - start)
}
}
if (!_value.isDefined)
throw new FutureTimeoutException("Futures timed out after [" + timeout + "] milliseconds")
this
} finally {
_lock.unlock