Struct vasi_sync::scmutex::SelfContainedMutexGuard
source · pub struct SelfContainedMutexGuard<'a, T> { /* private fields */ }
Implementations§
source§impl<'a, T> SelfContainedMutexGuard<'a, T>
impl<'a, T> SelfContainedMutexGuard<'a, T>
sourcepub fn disconnect(self)
pub fn disconnect(self)
Drops the guard without releasing the lock.
This is useful when a lock must be held across some span of code within a single thread, but it’s difficult to pass the the guard between the two parts of the code.
sourcepub fn reconnect(mutex: &'a SelfContainedMutex<T>) -> Self
pub fn reconnect(mutex: &'a SelfContainedMutex<T>) -> Self
Reconstitutes a guard that was previously disposed of via disconnect
.
Panics if the lock is not disconnected (i.e. if reconnect
was
already called).
Ok to reconnect from a different thread,though some external synchronization may be needed to ensure the mutex is disconnected before it tries to do so.
Trait Implementations§
source§impl<'a, T> Deref for SelfContainedMutexGuard<'a, T>
impl<'a, T> Deref for SelfContainedMutexGuard<'a, T>
source§impl<'a, T> DerefMut for SelfContainedMutexGuard<'a, T>where
T: Unpin,
impl<'a, T> DerefMut for SelfContainedMutexGuard<'a, T>where
T: Unpin,
When T is Unpin, we can implement DerefMut. Otherwise it’s unsafe to do so, since SelfContainedMutex is an Archive type.
Auto Trait Implementations§
impl<'a, T> Freeze for SelfContainedMutexGuard<'a, T>
impl<'a, T> !RefUnwindSafe for SelfContainedMutexGuard<'a, T>
impl<'a, T> Send for SelfContainedMutexGuard<'a, T>where
T: Send,
impl<'a, T> !Sync for SelfContainedMutexGuard<'a, T>
impl<'a, T> Unpin for SelfContainedMutexGuard<'a, T>
impl<'a, T> !UnwindSafe for SelfContainedMutexGuard<'a, 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