pub struct RcuLock<T, L = RcuLockLevel> { /* private fields */ }Expand description
A synchronization wrapper that combines an RCU primitive T with a lock at level L to
serialize updates while permitting lock-free RCU reads.
Readers access the underlying RCU value without acquiring the mutex via the read methods on
DynamicRcuLock. Writers must acquire the mutex via DynamicRcuLock::lock or
DynamicRcuLock::try_lock to obtain an RcuLockGuard, which grants exclusive writer
access to T.
Implementations§
Methods from Deref<Target = DynamicRcuLock<T>>§
Sourcepub fn lock(&self) -> RcuLockGuard<'_, T>
pub fn lock(&self) -> RcuLockGuard<'_, T>
Acquires the update lock and returns a guard that allows updating the RCU cell.
Sourcepub fn try_lock(&self) -> Option<RcuLockGuard<'_, T>>
pub fn try_lock(&self) -> Option<RcuLockGuard<'_, T>>
Attempts to acquire the update lock without blocking.
Trait Implementations§
Source§impl<T, L> MutexLike for RcuLock<T, L>
impl<T, L> MutexLike for RcuLock<T, L>
type Guard<'a> = RcuLockGuard<'a, T> where T: 'a, L: 'a
type Context = <DynamicRcuLock<T> as MutexLike>::Context
fn context() -> Self::Context
Source§fn lock(&self, context: &mut Self::Context) -> Self::Guard<'_>
fn lock(&self, context: &mut Self::Context) -> Self::Guard<'_>
Lock the mutex.
level is the index of the locked mutex in the lock ordering.fn key(&self) -> *const ()where
Self: Sized,
impl<T, L> RcuDroppable for RcuLock<T, L>where
DynamicRcuLock<T>: RcuDroppable,
PhantomData<L>: RcuDroppable,
T: RcuDroppable,
L: RcuDroppable,
Source§impl<T, L> ResetDependencies for RcuLock<T, L>
impl<T, L> ResetDependencies for RcuLock<T, L>
Source§unsafe fn reset_dependencies(&self)
unsafe fn reset_dependencies(&self)
Resets the lock dependency graph for this lock. Read more
Auto Trait Implementations§
impl<T, L = RcuLockLevel> !Freeze for RcuLock<T, L>
impl<T, L = RcuLockLevel> !RefUnwindSafe for RcuLock<T, L>
impl<T, L> Send for RcuLock<T, L>
impl<T, L> Sync for RcuLock<T, L>
impl<T, L> Unpin for RcuLock<T, L>
impl<T, L> UnsafeUnpin for RcuLock<T, L>
impl<T, L> UnwindSafe for RcuLock<T, L>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
§impl<F, N> FidlIntoNative<Box<N>> for Fwhere
F: FidlIntoNative<N>,
impl<F, N> FidlIntoNative<Box<N>> for Fwhere
F: FidlIntoNative<N>,
fn fidl_into_native(self) -> Box<N>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more