pub struct MutexGuard<'a, T> {
mutex: &'a Mutex<T>,
}
Expand description
A lock on a mutex
Though a MutexGuard, a mutex’s inner value can be mutably accessed; the creation mechanism of the locks ensures that only one MutexGuard is ever available for any given Mutex.
When the lock is dropped, the mutex becomes available again.
Fields§
§mutex: &'a Mutex<T>
Implementations§
Source§impl<'a, T> MutexGuard<'a, T>
impl<'a, T> MutexGuard<'a, T>
Sourcepub fn unlock_and_sleep(self)
pub fn unlock_and_sleep(self)
Put the current thread to sleep right after unlocking the mutex. This is equivalent to calling mutex_unlock_and_sleep in RIOT.
Trait Implementations§
Source§impl<'a, T> Deref for MutexGuard<'a, T>
impl<'a, T> Deref for MutexGuard<'a, T>
Source§impl<'a, T> DerefMut for MutexGuard<'a, T>
impl<'a, T> DerefMut for MutexGuard<'a, T>
Auto Trait Implementations§
impl<'a, T> Freeze for MutexGuard<'a, T>
impl<'a, T> !RefUnwindSafe for MutexGuard<'a, T>
impl<'a, T> Send for MutexGuard<'a, T>where
T: Send,
impl<'a, T> Sync for MutexGuard<'a, T>where
T: Send,
impl<'a, T> Unpin for MutexGuard<'a, T>
impl<'a, T> !UnwindSafe for MutexGuard<'a, T>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoSwitch for T
impl<T> IntoSwitch for T
Source§fn into_switch<ActiveLevel>(self) -> Switch<T, ActiveLevel>
fn into_switch<ActiveLevel>(self) -> Switch<T, ActiveLevel>
Source§fn into_active_high_switch(self) -> Switch<Self, ActiveHigh>where
Self: Sized,
fn into_active_high_switch(self) -> Switch<Self, ActiveHigh>where
Self: Sized,
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 4 bytes