public bool IsInitializedGets a value indicating whether the cell has been initialized.
All Types / Ferrous.Concurrency
public sealed class OnceLock<T>
A thread-safe write-once synchronization cell inspired by Rust's std::sync::OnceLock<T>. Safe to store in static readonly fields without triggering FE0501.
Tpublic bool IsInitializedGets a value indicating whether the cell has been initialized.
public bool TryGet([MaybeNullWhen(false)] out T value)Attempts to read the initialized value without blocking.
public bool TrySet(T value)Attempts to initialize the cell with value. Returns false if already initialized.
public T GetOrInit(Func<T> factory)Returns the initialized value, invoking factory at most once if uninitialized.