pub struct SpinRwLock<T: ?Sized> { /* private fields */ }Expand description
A preemptible RT reader/writer lock with a single-writer PI gate.
Readers already holding the lock cannot receive a writer’s donation. Each successful guard pins migration but leaves hardware IRQs enabled.
Implementations§
Source§impl<T> SpinRwLock<T>
impl<T> SpinRwLock<T>
Sourcepub fn into_inner(self) -> T
pub fn into_inner(self) -> T
Returns the protected value through exclusive object ownership.
Source§impl<T: ?Sized> SpinRwLock<T>
impl<T: ?Sized> SpinRwLock<T>
Sourcepub fn read(&self) -> SpinRwLockReadGuard<'_, T>
pub fn read(&self) -> SpinRwLockReadGuard<'_, T>
Acquires shared access in preemptible task context.
Sourcepub fn write(&self) -> SpinRwLockWriteGuard<'_, T>
pub fn write(&self) -> SpinRwLockWriteGuard<'_, T>
Acquires exclusive access, waiting for existing readers to finish.
Sourcepub fn try_read(&self) -> Option<SpinRwLockReadGuard<'_, T>>
pub fn try_read(&self) -> Option<SpinRwLockReadGuard<'_, T>>
Attempts shared access without sleeping.
Sourcepub fn try_write(&self) -> Option<SpinRwLockWriteGuard<'_, T>>
pub fn try_write(&self) -> Option<SpinRwLockWriteGuard<'_, T>>
Attempts exclusive access without sleeping.
Sourcepub fn read_irqsave(&self) -> SpinRwLockReadGuard<'_, T>
pub fn read_irqsave(&self) -> SpinRwLockReadGuard<'_, T>
RT IRQ-save spelling; hardware IRQ state remains unchanged.
Sourcepub fn write_irqsave(&self) -> SpinRwLockWriteGuard<'_, T>
pub fn write_irqsave(&self) -> SpinRwLockWriteGuard<'_, T>
RT IRQ-save spelling; hardware IRQ state remains unchanged.
Sourcepub fn try_read_irqsave(&self) -> Option<SpinRwLockReadGuard<'_, T>>
pub fn try_read_irqsave(&self) -> Option<SpinRwLockReadGuard<'_, T>>
RT IRQ-save spelling; hardware IRQ state remains unchanged.
Sourcepub fn try_write_irqsave(&self) -> Option<SpinRwLockWriteGuard<'_, T>>
pub fn try_write_irqsave(&self) -> Option<SpinRwLockWriteGuard<'_, T>>
RT IRQ-save spelling; hardware IRQ state remains unchanged.
Trait Implementations§
Auto Trait Implementations§
impl<T> !Freeze for SpinRwLock<T>
impl<T> !RefUnwindSafe for SpinRwLock<T>
impl<T> !UnwindSafe for SpinRwLock<T>
impl<T> Send for SpinRwLock<T>
impl<T> Sync for SpinRwLock<T>
impl<T> Unpin for SpinRwLock<T>
impl<T> UnsafeUnpin for SpinRwLock<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