pub trait RawLock {
type LockEntry: Default;
type DefaultPolicy: LockPolicy<Self>;
const LOCK_FLAGS: LockFlags = lockdep::LOCK_FLAGS_NONE;
// Required methods
unsafe fn init(class_id: *const c_void) -> impl PinInit<Self, Infallible>
where Self: Sized;
fn as_mut_ptr(&self) -> *mut c_void;
}Expand description
Trait defining a raw, un-instrumented synchronization lock abstraction.
Implementors of RawLock supply the platform-specific lock storage, in-place pinning
initialization logic, and raw synchronization entry points for lock validation systems.
Provided Associated Constants§
Sourceconst LOCK_FLAGS: LockFlags = lockdep::LOCK_FLAGS_NONE
const LOCK_FLAGS: LockFlags = lockdep::LOCK_FLAGS_NONE
Flags specifying validation rules for the lock class.
Required Associated Types§
Sourcetype LockEntry: Default
type LockEntry: Default
Opaque stack entry storage type used by the lock validation loop detector (e.g. LockDep).
Sourcetype DefaultPolicy: LockPolicy<Self>
type DefaultPolicy: LockPolicy<Self>
Default policy that should be used when acquiring this lock.
Required Methods§
Sourceunsafe fn init(class_id: *const c_void) -> impl PinInit<Self, Infallible>where
Self: Sized,
unsafe fn init(class_id: *const c_void) -> impl PinInit<Self, Infallible>where
Self: Sized,
Returns a PinInit block to initialize the raw mutex in-place.
§Safety
The caller must ensure that class_id is either null or points to a valid,
static LockClassId that remains valid for the lifetime of the lock.
Sourcefn as_mut_ptr(&self) -> *mut c_void
fn as_mut_ptr(&self) -> *mut c_void
Convert the raw mutex reference to a standard c_void pointer for FFI.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".