Skip to main content

try_lock_exclusive

Function try_lock_exclusive 

Source
pub fn try_lock_exclusive(f: &File) -> Result<bool>
Expand description

Advisory whole-file lock, non-blocking (2n reader table). Ok(true) = acquired; Ok(false) = held by a live process. The lock dies with the fd – crash-safe by construction. Platform code lives HERE (the 2d rule).