Wrapper for lazy vals used within methods. lazy vals in methods synchronize
on the object instance, not in the scope of the method. Thus multiple threads
can block on evaluating the same lazy val in the method.
ALWAYS USE THIS IF YOU WANT TO USE A lazy val IN A METHOD, e.g.
def myLazilyEvaluatedFunc(..) = {..}
val l = LazyLocal(myLazilyEvaluatedFunc)
...
l.value
Wrapper for lazy vals used within methods. lazy vals in methods synchronize on the object instance, not in the scope of the method. Thus multiple threads can block on evaluating the same lazy val in the method.
ALWAYS USE THIS IF YOU WANT TO USE A lazy val IN A METHOD, e.g.
def myLazilyEvaluatedFunc(..) = {..} val l = LazyLocal(myLazilyEvaluatedFunc) ... l.value