Acquire an exclusive lock on a directory via a lock file.
Declared in <util/fs_helpers.h>
[[nodiscard]]
LockResult
LockDirectory(
fs::path const& directory,
fs::path const& lockfile_name,
bool probe_only = false);
A LockResult describing whether the lock was acquired.
The return value should not be discarded.
| Name | Description |
|---|---|
| directory [in] | The directory to lock. |
| lockfile_name [in] | The name of the lock file to create inside the directory. |
| probe_only [in] | If true, test whether the lock can be taken without holding it. |