pub struct KMutexGuardMultiple<'a, const N: usize, Class: LockClass, M: RawLock = RawMutex, P: LockPolicy<M> = <M as RawLock>::DefaultPolicy> { /* private fields */ }Expand description
Guards simultaneous acquisitions of multiple locks of the same class and type.
Locks are automatically sorted in-place by ascending memory address before acquisition to
preserve the intra-class ordering invariant and prevent AB/BA deadlocks, matching C++
lockdep::GuardMultiple.
Implementations§
Source§impl<'a, const N: usize, Class: LockClass, M: RawLock, P: LockPolicy<M>> KMutexGuardMultiple<'a, N, Class, M, P>
impl<'a, const N: usize, Class: LockClass, M: RawLock, P: LockPolicy<M>> KMutexGuardMultiple<'a, N, Class, M, P>
Source§impl<'a, const N: usize, Class: LockClass, M: RawLock, P: LockPolicy<M>> KMutexGuardMultiple<'a, N, Class, M, P>
impl<'a, const N: usize, Class: LockClass, M: RawLock, P: LockPolicy<M>> KMutexGuardMultiple<'a, N, Class, M, P>
Sourcepub fn new(locks: [&'a KMutex<Class, M>; N]) -> impl PinInit<Self, Infallible>where
P: LockPolicy<M, AcquireArgs = ()>,
pub fn new(locks: [&'a KMutex<Class, M>; N]) -> impl PinInit<Self, Infallible>where
P: LockPolicy<M, AcquireArgs = ()>,
Creates a new stack-pinned multi-lock validation guard initialization block.
Sourcepub fn new_with_args(
locks: [&'a KMutex<Class, M>; N],
args: P::AcquireArgs,
) -> impl PinInit<Self, Infallible>
pub fn new_with_args( locks: [&'a KMutex<Class, M>; N], args: P::AcquireArgs, ) -> impl PinInit<Self, Infallible>
Creates a new stack-pinned multi-lock validation guard initialization block with policy acquire arguments.
Sourcepub fn tokens(&self) -> &[LockToken<'a, Class>; N]
pub fn tokens(&self) -> &[LockToken<'a, Class>; N]
Returns shared references to the lock proof tokens.
Sourcepub fn tokens_mut(self: Pin<&mut Self>) -> &mut [LockToken<'a, Class>; N]
pub fn tokens_mut(self: Pin<&mut Self>) -> &mut [LockToken<'a, Class>; N]
Returns mutable references to the lock proof tokens.
Trait Implementations§
Source§impl<'a, const N: usize, Class: LockClass, M: RawLock, P: LockPolicy<M>> Drop for KMutexGuardMultiple<'a, N, Class, M, P>
impl<'a, const N: usize, Class: LockClass, M: RawLock, P: LockPolicy<M>> Drop for KMutexGuardMultiple<'a, N, Class, M, P>
Source§impl<'a, const N: usize, Class: LockClass, M: RawLock, P: LockPolicy<M>> HasPinData for KMutexGuardMultiple<'a, N, Class, M, P>
impl<'a, const N: usize, Class: LockClass, M: RawLock, P: LockPolicy<M>> HasPinData for KMutexGuardMultiple<'a, N, Class, M, P>
Source§impl<'a, const N: usize, Class: LockClass, M: RawLock, P: LockPolicy<M>> PinnedDrop for KMutexGuardMultiple<'a, N, Class, M, P>
impl<'a, const N: usize, Class: LockClass, M: RawLock, P: LockPolicy<M>> PinnedDrop for KMutexGuardMultiple<'a, N, Class, M, P>
Auto Trait Implementations§
impl<'a, const N: usize, Class, M = RawMutex, P = <M as RawLock>::DefaultPolicy> !Send for KMutexGuardMultiple<'a, N, Class, M, P>
impl<'a, const N: usize, Class, M = RawMutex, P = <M as RawLock>::DefaultPolicy> !Sync for KMutexGuardMultiple<'a, N, Class, M, P>
impl<'a, const N: usize, Class, M, P> Freeze for KMutexGuardMultiple<'a, N, Class, M, P>
impl<'a, const N: usize, Class, M, P> RefUnwindSafe for KMutexGuardMultiple<'a, N, Class, M, P>where
<M as RawLock>::LockEntry: RefUnwindSafe,
<P as LockPolicy<M>>::GuardState: RefUnwindSafe,
M: RefUnwindSafe,
Class: RefUnwindSafe,
impl<'a, const N: usize, Class, M, P> UnsafeUnpin for KMutexGuardMultiple<'a, N, Class, M, P>
impl<'a, const N: usize, Class, M, P> UnwindSafe for KMutexGuardMultiple<'a, N, Class, M, P>where
<M as RawLock>::LockEntry: UnwindSafe,
<P as LockPolicy<M>>::GuardState: UnwindSafe,
M: RefUnwindSafe,
Class: RefUnwindSafe,
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T, U> Into<U> for Twhere
U: From<T>,
impl<T, U> Into<U> for Twhere
U: From<T>,
Source§impl<T> PinInit<T> for T
impl<T> PinInit<T> for T
Source§unsafe fn __pinned_init(self, slot: *mut T) -> Result<(), !>
unsafe fn __pinned_init(self, slot: *mut T) -> Result<(), !>
Initializes
slot. Read moreSource§fn pin_chain<F>(self, f: F) -> ChainPinInit<Self, F, T, E>where
F: FnOnce(Pin<&mut T>) -> Result<(), E>,
fn pin_chain<F>(self, f: F) -> ChainPinInit<Self, F, T, E>where
F: FnOnce(Pin<&mut T>) -> Result<(), E>,
First initializes the value using
self then calls the function f with the initialized
value. Read more