pub struct RwSpinLocked<T> {
lock: RwSpinLock,
value: UnsafeCell<T>,
}Expand description
Protects a value with a busy-waiting reader-writer lock.
Multiple readers may access the value concurrently, while a writer has exclusive access. This lock is not reentrant and does not provide writer priority.
Fields§
§lock: RwSpinLock§value: UnsafeCell<T>Implementations§
Source§impl<T> RwSpinLocked<T>
impl<T> RwSpinLocked<T>
Sourcepub fn read_lock(&self) -> RwSpinLockReadGuard<'_, T>
pub fn read_lock(&self) -> RwSpinLockReadGuard<'_, T>
Locks the value for shared read access.
Sourcepub fn write_lock(&self) -> RwSpinLockWriteGuard<'_, T>
pub fn write_lock(&self) -> RwSpinLockWriteGuard<'_, T>
Locks the value for exclusive write access.
Trait Implementations§
Auto Trait Implementations§
impl<T> !Freeze for RwSpinLocked<T>
impl<T> !RefUnwindSafe for RwSpinLocked<T>
impl<T> Unpin for RwSpinLocked<T>where
T: Unpin,
impl<T> UnsafeUnpin for RwSpinLocked<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for RwSpinLocked<T>where
T: UnwindSafe,
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