Skip to main content

with_lock

Function with_lock 

Source
pub fn with_lock<T>(path: &Path, f: impl FnOnce() -> T) -> T
Expand description

f, with the lock on path held: other threads and programs wait for it. Where no lock can be taken (a folder not writable), f runs all the same: writing it fails there anyway. Taken again by the thread holding it, it is held already.