Skip to main content

KMutexGuard

Struct KMutexGuard 

Source
pub struct KMutexGuard<'a, Class: LockClass, M: RawLock = RawMutex> { /* private fields */ }
Expand description

A validation guard representing exclusive lock ownership and active list participation.

The guard is pinned in memory to ensure that its lock_entry pointer remains safe and valid inside the C++ loop detector active thread list.

Implementations§

Source§

impl<'a, Class: LockClass, M: RawLock> KMutexGuard<'a, Class, M>

Source

pub fn project<'__pin>( self: Pin<&'__pin mut Self>, ) -> KMutexGuardProjection<'__pin, 'a, Class, M>

Pin-projects all fields of Self.

These fields are structurally pinned:

  • lock_entry

These fields are not structurally pinned:

  • mutex
  • state
  • token
Source§

impl<'a, Class: LockClass, M: RawLock> KMutexGuard<'a, Class, M>

Source

pub fn new(mutex: &'a KMutex<Class, M>) -> impl PinInit<Self, Infallible>

Creates a new stack-pinned validation guard initialization block.

Source

pub fn token(&self) -> &LockToken<'a, Class>

Returns a shared reference to the lock proof LockToken.

Source

pub fn token_mut(self: Pin<&mut Self>) -> &mut LockToken<'a, Class>

Returns a mutable reference to the lock proof LockToken inside this pinned projection.

Trait Implementations§

Source§

impl<'a, Class: LockClass, M: RawLock> Drop for KMutexGuard<'a, Class, M>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more
Source§

impl<'a, Class: LockClass, M: RawLock> HasPinData for KMutexGuard<'a, Class, M>

Source§

type PinData = __ThePinData<'a, Class, M>

Source§

unsafe fn __pin_data() -> Self::PinData

Source§

impl<'a, Class: LockClass, M: RawLock> PinnedDrop for KMutexGuard<'a, Class, M>

Source§

fn drop(self: Pin<&mut Self>, _: OnlyCallFromDrop)

Executes the pinned destructor of this type. Read more

Auto Trait Implementations§

§

impl<'a, Class, M> Freeze for KMutexGuard<'a, Class, M>
where <M as RawLock>::LockEntry: Freeze, <M as RawLock>::GuardState: Freeze,

§

impl<'a, Class, M> RefUnwindSafe for KMutexGuard<'a, Class, M>

§

impl<'a, Class, M = RawSyncMutex> !Send for KMutexGuard<'a, Class, M>

§

impl<'a, Class, M = RawSyncMutex> !Sync for KMutexGuard<'a, Class, M>

§

impl<'a, Class, M> UnsafeUnpin for KMutexGuard<'a, Class, M>

§

impl<'a, Class, M> UnwindSafe for KMutexGuard<'a, Class, M>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Init<T> for T

Source§

unsafe fn __init(self, slot: *mut T) -> Result<(), Infallible>

Initializes slot. Read more
Source§

fn chain<F>(self, f: F) -> ChainInit<Self, F, T, E>
where F: FnOnce(&mut T) -> Result<(), E>,

First initializes the value using self then calls the function f with the initialized value. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PinInit<T> for T

Source§

unsafe fn __pinned_init(self, slot: *mut T) -> Result<(), Infallible>

Initializes slot. Read more
Source§

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
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.