pub trait SafeLock<T> {
// Required methods
fn safe_lock(&self) -> TrackingResult<MutexGuard<'_, T>>;
fn try_safe_lock(&self) -> TrackingResult<Option<MutexGuard<'_, T>>>;
}
Expand description
Safe lock operations - replaces .lock().expect(“Failed to acquire lock”)
Required Methods§
Sourcefn safe_lock(&self) -> TrackingResult<MutexGuard<'_, T>>
fn safe_lock(&self) -> TrackingResult<MutexGuard<'_, T>>
Safely acquire lock with timeout and error handling
Sourcefn try_safe_lock(&self) -> TrackingResult<Option<MutexGuard<'_, T>>>
fn try_safe_lock(&self) -> TrackingResult<Option<MutexGuard<'_, T>>>
Try to acquire lock without blocking