Function get_or_init_flags_cache

Source
pub fn get_or_init_flags_cache(
    cache: &AtomicU32,
    init: impl FnOnce() -> Flags,
) -> Flags
Expand description

Load flags from an atomic value. If the flags have not yet been initialized, call init to do so.

Note that init may run more than once.