pub struct MutexRef<'a, System>(_, _)
where
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> MutexRef<'static, System>where
System: KernelMutex,
impl<System> MutexRef<'static, System>where System: KernelMutex,
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> Clone for MutexRef<'_, System>where
System: KernelMutex,
impl<System> Clone for MutexRef<'_, System>where System: KernelMutex,
source§impl<System> Debug for MutexRef<'_, System>where
System: KernelMutex,
impl<System> Debug for MutexRef<'_, System>where System: KernelMutex,
source§impl<System> Hash for MutexRef<'_, System>where
System: KernelMutex,
impl<System> Hash for MutexRef<'_, System>where System: KernelMutex,
source§impl<System> MutexHandle for MutexRef<'_, System>where
System: KernelMutex,
impl<System> MutexHandle for MutexRef<'_, System>where System: KernelMutex,
source§const unsafe fn from_id(
id: <System as KernelMutex>::RawMutexId
) -> MutexRef<'_, System>
const unsafe fn from_id( id: <System as KernelMutex>::RawMutexId ) -> MutexRef<'_, System>
source§const fn id(&self) -> <System as KernelMutex>::RawMutexId
const fn id(&self) -> <System as KernelMutex>::RawMutexId
Get the raw
RawMutexId
value representing this object.source§impl<System> PartialEq<Mutex<System>> for MutexRef<'_, System>where
System: NotSupportedYet,
impl<System> PartialEq<Mutex<System>> for MutexRef<'_, System>where System: NotSupportedYet,
source§impl<System> PartialEq<MutexRef<'_, System>> for Mutex<System>where
System: NotSupportedYet,
impl<System> PartialEq<MutexRef<'_, System>> for Mutex<System>where System: NotSupportedYet,
source§impl<System> PartialEq<MutexRef<'_, System>> for MutexRef<'_, System>where
System: KernelMutex,
impl<System> PartialEq<MutexRef<'_, System>> for MutexRef<'_, System>where System: KernelMutex,
impl<System> Copy for MutexRef<'_, System>where System: KernelMutex,
impl<System> Eq for MutexRef<'_, System>where System: KernelMutex,
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.