BaseDoubleCheck

abstract class BaseDoubleCheck<T : Any>(provider: Provider<T>) : SynchronizedObject, Provider<T> , Lazy<T> (source)

A Lazy and Provider implementation that memoizes the value returned from a provider. The provider instance is released after it's called.

Modification notes:

  • Some semantics from the kotlin stdlib's synchronized Lazy impl are ported to here.

  • Uses AtomicFu's synchronized + SynchronizedObject APIs for KMP support.

  • The _value will eagerly return if initialized

  • _value is @Volatile

Inheritors

Constructors

Link copied to clipboard
constructor(provider: Provider<T>)

Properties

Link copied to clipboard
open override val value: T

Functions

Link copied to clipboard
open operator override fun invoke(): T
Link copied to clipboard
open override fun isInitialized(): Boolean