Throw an exception if Future.await is called on an expired and uncompleted Future. Ref #659
This commit is contained in:
parent
db79e2bd62
commit
b625b56ee3
1 changed files with 2 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue