Trait kernel::sync::NeedsLockClass[][src]

pub trait NeedsLockClass {
    unsafe fn init(
        self: Pin<&mut Self>,
        name: &'static CStr,
        key: *mut lock_class_key
    ); }
Expand description

A trait for types that need a lock class during initialisation.

Implementers of this trait benefit from the [init_with_lockdep] macro that generates a new class for each initialisation call site.

Required methods

Initialises the type instance so that it can be safely used.

Callers are encouraged to use the [init_with_lockdep] macro as it automatically creates a new lock class on each usage.

Safety

key must point to a valid memory location as it will be used by the kernel.

Implementors