Expand description
Project-level advisory file lock for setup. Dual-rail: fs2::FileExt::try_lock_exclusive
- PID/start_time sentinel JSON. Sentinel handles sandbox/NFS/container edge cases where flock alone is unreliable.
Acquire order:
- Read
.atomcode/.setup.lock.sentinelif present. If recorded PID is alive and its start_time matches, returnLockError::Held(unlessforce = true). Stale sentinel is removed. try_lock_exclusiveon.atomcode/.setup.lock— second rail.- Write a fresh sentinel JSON with current PID, start_time, host, version.
Drop releases both rails (unlock fs2, rm sentinel) but keeps the .setup.lock
file so future opens reuse the inode.