Yep, but I would guess it can call the lambda multiple times under heavy concurrent access. Just like in normal atomics.
m
Marc Knaup
08/23/2020, 5:02 PM
Thanks, that sounds good!
So I basically use
lazy
on JVM/JS and
atomicLazy
on native 🙂
The part “may potentially leak memory” sounds a bit worrying. But I don’t have cyclical references here so it’s probably OK.
My operations are idempotent, so it’s okay if the lambda is called multiple times.