TLazyInitializer Record

Provides lazy initialization routines.

Namespace: Spring
type
 TLazyInitializer = record
 end;

The TLazyInitializer type exposes the following members.

Show:
 NameDescription
EnsureInitialized<T>(T)

Overloaded. Initializes a target reference type by using a specified function if it hasn't already been initialized.

EnsureInitialized<T>(T,TFunc)

Overloaded. Initializes a target reference type by using a specified function if it hasn't already been initialized.

Top

The methods are using AtomicCmpExchange to ensure thread-safety when initializing instances.