Lock in rustc_data_structures::sync::lock - Rust (original) (raw)

pub struct Lock<T> {
    mode: Mode,
    mode_union: ModeUnion,
    data: UnsafeCell<T>,
}

Expand description

A lock which only uses synchronization if might_be_dyn_thread_safe is true. It implements DynSend and DynSync instead of the typical Send and Sync.

Indicates if synchronization is used via mode_union.sync if it’s Sync, or if a not thread safe cell is used via mode_union.no_sync if it’s NoSync. This is set on initialization and never changed.

Note: Unable to compute type layout, possibly due to this type having generic parameters. Layout can only be computed for concrete, fully-instantiated types.