#[repr(transparent)]pub struct MutexRef<'a, System: KernelMutex>(_, _);
Expand description
Represents a single borrowed mutex in a system.
This type is ABI-compatible with System::
RawMutexId
. It’s
logically equivalent to &'a Mutex
but instead stores RawMutexId
directly.
See Mutex
for the owned counterpart and the description
of this kernel object.
See MutexMethods
for the operations provided by this handle
type.
Implementations§
source§impl<System: KernelMutex> MutexRef<'static, System>
impl<System: KernelMutex> MutexRef<'static, System>
sourcepub const fn define() -> MutexDefiner<System>
pub const fn define() -> MutexDefiner<System>
Construct a MutexDefiner
to define a mutex in a
configuration function.
Trait Implementations§
source§impl<System: KernelMutex> Clone for MutexRef<'_, System>
impl<System: KernelMutex> Clone for MutexRef<'_, System>
source§impl<System: KernelMutex> Debug for MutexRef<'_, System>
impl<System: KernelMutex> Debug for MutexRef<'_, System>
source§impl<System: KernelMutex> Hash for MutexRef<'_, System>
impl<System: KernelMutex> Hash for MutexRef<'_, System>
source§impl<System: KernelMutex> MutexHandle for MutexRef<'_, System>
impl<System: KernelMutex> MutexHandle for MutexRef<'_, System>
source§const unsafe fn from_id(id: <System as KernelMutex>::RawMutexId) -> Self
const unsafe fn from_id(id: <System as KernelMutex>::RawMutexId) -> Self
source§const fn id(&self) -> System::RawMutexId
const fn id(&self) -> System::RawMutexId
Get the raw
RawMutexId
value representing this object.source§impl<System: NotSupportedYet> PartialEq<Mutex<System>> for MutexRef<'_, System>
impl<System: NotSupportedYet> PartialEq<Mutex<System>> for MutexRef<'_, System>
source§impl<System: NotSupportedYet> PartialEq<MutexRef<'_, System>> for Mutex<System>
impl<System: NotSupportedYet> PartialEq<MutexRef<'_, System>> for Mutex<System>
source§impl<System: KernelMutex> PartialEq<MutexRef<'_, System>> for MutexRef<'_, System>
impl<System: KernelMutex> PartialEq<MutexRef<'_, System>> for MutexRef<'_, System>
impl<System: KernelMutex> Copy for MutexRef<'_, System>
impl<System: KernelMutex> Eq for MutexRef<'_, System>
Auto Trait Implementations§
impl<'a, System> RefUnwindSafe for MutexRef<'a, System>where <System as KernelMutex>::RawMutexId: RefUnwindSafe,
impl<'a, System> Send for MutexRef<'a, System>
impl<'a, System> Sync for MutexRef<'a, System>
impl<'a, System> Unpin for MutexRef<'a, System>where <System as KernelMutex>::RawMutexId: Unpin,
impl<'a, System> UnwindSafe for MutexRef<'a, System>where <System as KernelMutex>::RawMutexId: UnwindSafe,
Blanket Implementations§
source§impl<T> MutexMethods for Twhere
T: MutexHandle,
impl<T> MutexMethods for Twhere T: MutexHandle,
source§fn is_locked(&self) -> Result<bool, QueryMutexError>
fn is_locked(&self) -> Result<bool, QueryMutexError>
Get a flag indicating whether the mutex is currently locked.
source§fn lock(&self) -> Result<(), LockMutexError>
fn lock(&self) -> Result<(), LockMutexError>
Acquire the mutex, blocking the current thread until it is able to do
so. Read more
source§fn lock_timeout(&self, timeout: Duration) -> Result<(), LockMutexTimeoutError>
fn lock_timeout(&self, timeout: Duration) -> Result<(), LockMutexTimeoutError>
lock
with timeout.source§fn try_lock(&self) -> Result<(), TryLockMutexError>
fn try_lock(&self) -> Result<(), TryLockMutexError>
Non-blocking version of
lock
. Returns
immediately with TryLockMutexError::Timeout
if the unblocking
condition is not satisfied. Read moresource§fn mark_consistent(&self) -> Result<(), MarkConsistentMutexError>
fn mark_consistent(&self) -> Result<(), MarkConsistentMutexError>
Mark the state protected by the mutex as consistent.