pub struct SpinLock<T: ?Sized> { /* private fields */ }Expand description
Linux PREEMPT_RT spinlock semantics: contention sleeps with saved task state.
Holding this lock disables migration, not preemption or hardware interrupts.
Interrupt handlers and scheduler transactions must use super::RawSpinLock.
Implementations§
Source§impl<T> SpinLock<T>
impl<T> SpinLock<T>
Sourcepub fn into_inner(self) -> T
pub fn into_inner(self) -> T
Returns the value when the lock is exclusively owned.
Source§impl<T: ?Sized> SpinLock<T>
impl<T: ?Sized> SpinLock<T>
Sourcepub fn lock(&self) -> SpinLockGuard<'_, T>
pub fn lock(&self) -> SpinLockGuard<'_, T>
Acquires the lock in task context, preserving an outer wait publication.
Sourcepub fn try_lock(&self) -> Option<SpinLockGuard<'_, T>>
pub fn try_lock(&self) -> Option<SpinLockGuard<'_, T>>
Attempts acquisition without waiting; fails in a non-task context.
Sourcepub fn lock_irqsave(&self) -> SpinLockGuard<'_, T>
pub fn lock_irqsave(&self) -> SpinLockGuard<'_, T>
RT IRQ-save spelling; hardware IRQ state is unchanged.
Sourcepub fn try_lock_irqsave(&self) -> Option<SpinLockGuard<'_, T>>
pub fn try_lock_irqsave(&self) -> Option<SpinLockGuard<'_, T>>
RT IRQ-save trylock; hardware IRQ state is unchanged.
Trait Implementations§
Auto Trait Implementations§
impl<T> !Freeze for SpinLock<T>
impl<T> !RefUnwindSafe for SpinLock<T>
impl<T> Send for SpinLock<T>
impl<T> Sync for SpinLock<T>
impl<T> Unpin for SpinLock<T>
impl<T> UnsafeUnpin for SpinLock<T>
impl<T> UnwindSafe for SpinLock<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