Skip to main content

acquire_lock

Function acquire_lock 

Source
pub fn acquire_lock(path: &Path, timeout: Duration) -> Result<LockGuard>
Expand description

Acquire an exclusive flock on path, blocking up to timeout. Returned guard releases the lock on drop.

The flock file is created if missing, but its content is unused — only the lock matters.