Added Future[T] as return type for await and awaitBlocking

This commit is contained in:
Viktor Klang 2010-04-25 18:07:27 +02:00
parent 4bc833acae
commit 2b9f7be1a7

View file

@ -71,8 +71,8 @@ object Futures {
}
sealed trait Future[T] {
def await
def awaitBlocking
def await : Future[T]
def awaitBlocking : Future[T]
def isCompleted: Boolean
def isExpired: Boolean
def timeoutInNanos: Long
@ -111,6 +111,7 @@ class DefaultCompletableFuture[T](timeout: Long) extends CompletableFuture[T] {
wait = wait - (currentTimeInNanos - start)
}
}
this
} finally {
_lock.unlock
}
@ -120,6 +121,7 @@ class DefaultCompletableFuture[T](timeout: Long) extends CompletableFuture[T] {
while (!_completed) {
_signal.await
}
this
} finally {
_lock.unlock
}