Expand description
The computer-wide sync lock (SPEC_USER_DATA_SYNC_LAYER §3.1). The identity store, and with it the Kanban and the
Vaults, is shared by every AgentMux on a computer, so only one install may act as the computer’s member: sign
records as it, run the sync loop and answer sync.* ops. That install holds this lock, a single row in the shared
store taken by compare-and-set with a lease. An install that does not hold it never signs as the member and never
runs the loop; a crashed holder is replaced when its lease runs out. Each taking raises a generation, so a holder
that was replaced finds its renewal refused and stops (a fence, like a task claim’s attempt).
Enums§
- Lock
- The answer to a request for the lock.
Constants§
- LEASE_
MS - How long a lease lasts before a crashed holder can be replaced.
Functions§
- acquire
- Takes the lock for
installif it is free, expired or already its own. One statement decides, so two installs asking at once cannot both get it. - holds
- Whether
installholds the lock atgenerationright now: the check made before signing as the member. - init
- release
- Gives the lock up (an install shutting down), if it holds it.
- renew
- Extends the lease if
installstill holds the lock atgeneration; false means it was replaced and must stop.