Skip to main content

lock

Function lock 

Source
pub fn lock(lock_path: &Path) -> Result<File>
Expand description

Take the exclusive lock lock_path names, waiting for its holder. For the few file operations a hook must not interleave with another’s; the OS drops the lock when its holder exits, even if killed.