Skip to main content

Module lock

Module lock 

Source

Structs§

DirLock
Advisory, single-writer lock on a database directory (ADR-hjxp/0006), claimed with O_CREAT|O_EXCL and kept alive by a heartbeat that is written to a fresh temporary and renamed over the lock file (ADR-6wjp/0016), so a stale timestamp is never mistaken for proof that the holder is gone and no write ever follows a link somebody planted in the way.
GraceServed
A lease a caller has already challenged and waited the hand-over grace out on, in the shape that survives a trip out to a host and back: the owner token as the number its hex spells, and the heartbeat that token had not moved past.
LockHolder
The contents of .hayson.lock. owner is the only field ownership is decided on; pid and host are diagnostics, present on unix and absent on platforms without processes.
LockOptions
How the writer lock on a database directory is taken.
LockedError

Enums§

ChallengeOutcome
What DirLock::challenge found, having waited for nothing to find it.
DirLockError
LockState
What DirLock::inspect read out of the lock file, having changed nothing to read it.

Constants§

LOCK_FILE