pub struct SpinRwLock<T: ?Sized>(/* private fields */);Expand description
A non-sleeping read-write lock with acquisition-site context policy.
Implementations§
Source§impl<T> SpinRwLock<T>
impl<T> SpinRwLock<T>
Sourcepub fn into_inner(self) -> T
pub fn into_inner(self) -> T
Consumes the lock and returns the protected value.
Source§impl<T: ?Sized> SpinRwLock<T>
impl<T: ?Sized> SpinRwLock<T>
Sourcepub fn read(&self) -> SpinRwLockReadGuard<'_, T>
pub fn read(&self) -> SpinRwLockReadGuard<'_, T>
Acquires a read guard after disabling preemption.
Sourcepub fn try_read(&self) -> Option<SpinRwLockReadGuard<'_, T>>
pub fn try_read(&self) -> Option<SpinRwLockReadGuard<'_, T>>
Attempts a read acquisition after disabling preemption.
Sourcepub fn write(&self) -> SpinRwLockWriteGuard<'_, T>
pub fn write(&self) -> SpinRwLockWriteGuard<'_, T>
Acquires a write guard after disabling preemption.
Sourcepub fn try_write(&self) -> Option<SpinRwLockWriteGuard<'_, T>>
pub fn try_write(&self) -> Option<SpinRwLockWriteGuard<'_, T>>
Attempts a write acquisition after disabling preemption.
Sourcepub fn read_irqsave(&self) -> SpinRwLockIrqSaveReadGuard<'_, T>
pub fn read_irqsave(&self) -> SpinRwLockIrqSaveReadGuard<'_, T>
Acquires an IRQ-save read guard.
Sourcepub fn try_read_irqsave(&self) -> Option<SpinRwLockIrqSaveReadGuard<'_, T>>
pub fn try_read_irqsave(&self) -> Option<SpinRwLockIrqSaveReadGuard<'_, T>>
Attempts an IRQ-save read acquisition.
Sourcepub fn write_irqsave(&self) -> SpinRwLockIrqSaveWriteGuard<'_, T>
pub fn write_irqsave(&self) -> SpinRwLockIrqSaveWriteGuard<'_, T>
Acquires an IRQ-save write guard.
Sourcepub fn try_write_irqsave(&self) -> Option<SpinRwLockIrqSaveWriteGuard<'_, T>>
pub fn try_write_irqsave(&self) -> Option<SpinRwLockIrqSaveWriteGuard<'_, T>>
Attempts an IRQ-save write acquisition.
Sourcepub unsafe fn read_raw(&self) -> RawSpinRwLockReadGuard<'_, T>
pub unsafe fn read_raw(&self) -> RawSpinRwLockReadGuard<'_, T>
Acquires a raw read guard without changing execution context.
§Safety
The caller must prevent re-entry and uphold the read-side exclusion contract, including on single-core builds.
Sourcepub unsafe fn try_read_raw(&self) -> Option<RawSpinRwLockReadGuard<'_, T>>
pub unsafe fn try_read_raw(&self) -> Option<RawSpinRwLockReadGuard<'_, T>>
Sourcepub unsafe fn write_raw(&self) -> RawSpinRwLockWriteGuard<'_, T>
pub unsafe fn write_raw(&self) -> RawSpinRwLockWriteGuard<'_, T>
Acquires a raw write guard without changing execution context.
§Safety
The caller must prevent re-entry and concurrent readers or writers, including on single-core builds.