summaryrefslogtreecommitdiff
path: root/src/library/scala/concurrent/DelayedLazyVal.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/library/scala/concurrent/DelayedLazyVal.scala')
-rw-r--r--src/library/scala/concurrent/DelayedLazyVal.scala8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/library/scala/concurrent/DelayedLazyVal.scala b/src/library/scala/concurrent/DelayedLazyVal.scala
index 391ba7e314..0b7f54a27a 100644
--- a/src/library/scala/concurrent/DelayedLazyVal.scala
+++ b/src/library/scala/concurrent/DelayedLazyVal.scala
@@ -26,21 +26,23 @@ package scala.concurrent
class DelayedLazyVal[T](f: () => T, body: => Unit) {
@volatile private[this] var _isDone = false
private[this] lazy val complete = f()
-
+
/** Whether the computation is complete.
*
* @return true if the computation is complete.
*/
def isDone = _isDone
-
+
/** The current result of f(), or the final result if complete.
*
* @return the current value
*/
def apply(): T = if (isDone) complete else f()
-
+
+ // TODO replace with scala.concurrent.future { ... }
ops.future {
body
_isDone = true
}
+
}