#[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.0.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 ==.