acquire_lock_with_timeout

Function acquire_lock_with_timeout 

Source
fn acquire_lock_with_timeout<T>(
    mutex: &Mutex<T>,
    timeout: Duration,
) -> Result<MutexGuard<'_, T>>
Expand description

Alternative lock acquisition with spin-wait timeout.

Note: Rust’s std::sync::Mutex doesn’t have a native try_lock_for, so we implement a spin-wait with sleep. For production, consider using parking_lot::Mutex which has proper timed locking.

Reserved for future use - currently using simpler acquire_lock with poison recovery.