Skip to main content

lock_arc_mutex

Function lock_arc_mutex 

Source
pub fn lock_arc_mutex<T>(arc_mutex: &Arc<Mutex<T>>) -> Option<MutexGuard<'_, T>>
Expand description

Helper function to lock an Arc<Mutex> and access its value Returns None if the mutex is poisoned Note: This returns a guard, not a reference, so it cannot be used in keypaths directly