pub fn lock(dir: &Path, sharing: Sharing) -> Result<DataDirLock, LockError>Expand description
Takes the data directory for work that shares it as sharing, or says
what holds it.
Two lock files carry the rule: lock, taken exclusively by a server and
by a command that runs alone, and lock.commands, shared by commands
that run beside a server and taken exclusively by one that runs alone.