[−][src]Struct sunrise_kernel::sync::mutex::MutexInner
The type responsible of actually performing the locking of the mutex.
Just a SpinLock<
MutexInnerInner
>>
.
This might seem a bit weird to have an intermediate a struct just for that, but it is to stay as close as possible to std's Mutex design, so we can copy-paste it with ease.
Fields
spin_lock: SpinLock<MutexInnerInner>
A spin lock arbitrating accesses to the mutex's state.
Implementations
impl MutexInner
[src]
unsafe fn try_lock(&self) -> bool
[src]
Try to obtain the mutex, without preempting.
Returns false if the mutex was not immediately available.
unsafe fn raw_lock(&self)
[src]
Locks the mutex blocking the current thread until it is available.
Panics
Panics if we're already the owner of the mutex, as this is a deadlock otherwise.
unsafe fn raw_unlock(&self)
[src]
Unlocks the mutex.
Consider switching from the pair of raw_lock() and raw_unlock() to lock() whenever possible.
Panics
Panics if the mutex wasn't held, or if our thread was not the owner of this mutex, as this definitely is a bug and we shouldn't have created a MutexGuard for it.
Auto Trait Implementations
impl !RefUnwindSafe for MutexInner
impl Send for MutexInner
impl Sync for MutexInner
impl Unpin for MutexInner
impl !UnwindSafe for MutexInner
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,