Skip to main content

Module locking

Module locking 

Source
Expand description

Concurrent startup locking with stale-lock recovery, and file-level locking for safe concurrent writes to .aplan files.

Only one instance of a named lock can be held at a time. Locks older than STALE_THRESHOLD whose owning process is no longer alive are automatically recovered.

Structs§

FileLock
File-level lock for .aplan files. Creates a .aplan.lock sidecar that prevents concurrent writes to the same planning file.
StartupLock
A PID-based lock file that auto-cleans on drop.

Enums§

LockError

Functions§

lock_path_for
Compute the .aplan.lock sidecar path for a given .aplan file.