# `SuperPi.Env.FileLock`
[🔗](https://github.com/oleksandr/super-pi-beam/blob/v0.1.0/lib/super_pi/env/file_lock.ex#L1)

Per-path advisory file lock server (`REQ-SAFE-04`, `REQ-PBT-05`).

Registered in `SuperPi.Registry` under `{:file_lock, env_id, canonical_path}` so concurrent
`write_file` and `edit_file` operations targeting the same path execute strictly sequentially
without lost updates or race conditions.

# `canonicalize_path`

# `child_spec`

Returns a specification to start this module under a supervisor.

See `Supervisor`.

# `start_link`

# `with_lock`

Executes `fun.()` inside the exclusive lock for `{env_id, path}`.
Resolves `Path.expand/1` before acquiring the lock so relative and absolute paths to the same
file share the same lock process.

# `with_lock`

---

*Consult [api-reference.md](api-reference.md) for complete listing*
