Trait kernel::sync::NeedsLockClass  
source · [−]pub trait NeedsLockClass {
    fn init(
        self: Pin<&mut Self>,
        name: &'static CStr,
        key1: &'static LockClassKey,
        key2: &'static LockClassKey
    );
}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
sourcefn init(
    self: Pin<&mut Self>,
    name: &'static CStr,
    key1: &'static LockClassKey,
    key2: &'static LockClassKey
)
 
fn init(
    self: Pin<&mut Self>,
    name: &'static CStr,
    key1: &'static LockClassKey,
    key2: &'static LockClassKey
)
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.