suspendLazy

expect fun <T> suspendLazy(mode: LazyThreadSafetyMode = LazyThreadSafetyMode.SYNCHRONIZED, initializer: suspend () -> T): SuspendLazy<T>(source)

Creates a SuspendLazy that runs initializer on first access.

LazyThreadSafetyMode.SYNCHRONIZED runs one initializer while other callers wait. LazyThreadSafetyMode.PUBLICATION allows initializers to overlap and caches one result. LazyThreadSafetyMode.NONE does not coordinate concurrent callers.

actual fun <T> suspendLazy(mode: LazyThreadSafetyMode, initializer: suspend () -> T): SuspendLazy<T>(source)

Creates a SuspendLazy that runs initializer on first access.

LazyThreadSafetyMode.SYNCHRONIZED runs one initializer while other callers wait. LazyThreadSafetyMode.PUBLICATION allows initializers to overlap and caches one result. LazyThreadSafetyMode.NONE does not coordinate concurrent callers.

actual fun <T> suspendLazy(mode: LazyThreadSafetyMode, initializer: suspend () -> T): SuspendLazy<T>(source)

Creates a SuspendLazy that runs initializer on first access.

LazyThreadSafetyMode.SYNCHRONIZED runs one initializer while other callers wait. LazyThreadSafetyMode.PUBLICATION allows initializers to overlap and caches one result. LazyThreadSafetyMode.NONE does not coordinate concurrent callers.

actual fun <T> suspendLazy(mode: LazyThreadSafetyMode, initializer: suspend () -> T): SuspendLazy<T>(source)

Creates a SuspendLazy that runs initializer on first access.

LazyThreadSafetyMode.SYNCHRONIZED runs one initializer while other callers wait. LazyThreadSafetyMode.PUBLICATION allows initializers to overlap and caches one result. LazyThreadSafetyMode.NONE does not coordinate concurrent callers.