atomicLazy
Deprecated
Error since 2.1
Support for the legacy memory manager has been completely removed. Use lazy() instead.
Replace with
lazy(initializer)
Content copied to clipboard
Atomic lazy initializer, could be used in frozen objects, freezes initializing lambda, so use very carefully. Also, as with other uses of an AtomicReference may potentially leak memory, so it is recommended to use atomicLazy
in cases of objects living forever, such as object singletons, or in cases where it's guaranteed not to have cyclical garbage.