diff options
author | Philipp Haller <hallerp@gmail.com> | 2011-12-13 09:03:30 +0100 |
---|---|---|
committer | Philipp Haller <hallerp@gmail.com> | 2011-12-13 09:03:30 +0100 |
commit | 5fcd1e067767b56ae323b0a37b169bf4e0a937b6 (patch) | |
tree | 6bb4110e5b26abf028d6e174694d9edea78e44d7 /src | |
parent | 9a04d0bea379c3fa12227493fddd0bffde9a569c (diff) | |
download | scala-5fcd1e067767b56ae323b0a37b169bf4e0a937b6.tar.gz scala-5fcd1e067767b56ae323b0a37b169bf4e0a937b6.tar.bz2 scala-5fcd1e067767b56ae323b0a37b169bf4e0a937b6.zip |
Fix default.ExecutionContextImpl.promise. Add promise test.
Diffstat (limited to 'src')
-rw-r--r-- | src/library/scala/concurrent/default/TaskImpl.scala | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/library/scala/concurrent/default/TaskImpl.scala b/src/library/scala/concurrent/default/TaskImpl.scala index b4c08ba710..ea465225c8 100644 --- a/src/library/scala/concurrent/default/TaskImpl.scala +++ b/src/library/scala/concurrent/default/TaskImpl.scala @@ -91,7 +91,7 @@ private[concurrent] class PromiseImpl[T](context: ExecutionContextImpl) * * $promiseCompletion */ - def fulfill(value: T): Unit = { + def success(value: T): Unit = { val cbs = tryCompleteState(Success(value)) if (cbs == null) throw new IllegalStateException @@ -109,7 +109,7 @@ private[concurrent] class PromiseImpl[T](context: ExecutionContextImpl) * * $promiseCompletion */ - def break(t: Throwable): Unit = { + def failure(t: Throwable): Unit = { val wrapped = wrap(t) val cbs = tryCompleteState(Failure(wrapped)) if (cbs == null) @@ -260,7 +260,7 @@ private[concurrent] final class ExecutionContextImpl extends ExecutionContext { } def promise[T]: Promise[T] = - null // TODO + new PromiseImpl[T](this) // TODO fix the timeout def blockingCall[T](timeout: Timeout, b: Blockable[T]): T = b match { |