#[repr(i32)]pub enum MutexThreadTerminationBehavior {
StallWhenLocked = 0,
ReleaseWhenLocked = 1,
}Expand description
Defines the behavior when a mutex owning thread is terminated
Variants§
StallWhenLocked = 0
The mutex stays locked, is unlockable and no longer usable. This can also lead to a mutex leak in the drop.
ReleaseWhenLocked = 1
It implies the same behavior as MutexType::WithDeadlockDetection. Additionally, when a
mutex owning
thread/process dies the mutex is put into an inconsistent state which can be recovered with
Mutex::make_consistent(). The inconsistent state is detected by the next instance which
calls Mutex::try_lock() or Mutex::timed_lock().
Important: If the owner dies after another thread has already locked the Mutex it
may become impossible to recover the Mutex. Therefore, this feature should be used
only in combination with either Mutex::try_lock or Mutex::timed_lock() and
never with Mutex::lock().
This is also known as robust mutex.
Trait Implementations§
source§impl Clone for MutexThreadTerminationBehavior
impl Clone for MutexThreadTerminationBehavior
source§fn clone(&self) -> MutexThreadTerminationBehavior
fn clone(&self) -> MutexThreadTerminationBehavior
1.6.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl PartialEq for MutexThreadTerminationBehavior
impl PartialEq for MutexThreadTerminationBehavior
source§fn eq(&self, other: &MutexThreadTerminationBehavior) -> bool
fn eq(&self, other: &MutexThreadTerminationBehavior) -> bool
self and other values to be equal, and is used by ==.impl Copy for MutexThreadTerminationBehavior
impl Eq for MutexThreadTerminationBehavior
impl StructuralPartialEq for MutexThreadTerminationBehavior
Auto Trait Implementations§
impl Freeze for MutexThreadTerminationBehavior
impl RefUnwindSafe for MutexThreadTerminationBehavior
impl Send for MutexThreadTerminationBehavior
impl Sync for MutexThreadTerminationBehavior
impl Unpin for MutexThreadTerminationBehavior
impl UnwindSafe for MutexThreadTerminationBehavior
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)