Skip to content

Is it necessary to use Ordering::SeqCst in the log! ?? #509

@relufi

Description

@relufi
pub fn logger() -> &'static dyn Log {
   // Is it necessary to use Ordering::SeqCst in log!
    if STATE.load(Ordering::SeqCst) != INITIALIZED {
        static NOP: NopLogger = NopLogger;
        &NOP
    } else {
        unsafe { LOGGER }
    }
}

See the implementation of std::lazy::SyncOnceCell or parking_lot::Once

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions