Expand description
Locks (spec/sync/README.md §7): advisory O_EXCL lock files under
.omgbase/ holding {"pid": <holder>, "ts": <ms>}; a lock whose holder
is dead (or whose body is unparsable — §9) is stolen. The writer lock
polls; the watch lease is try-only.
Structs§
- Watch
Lease - The watch lease (
watch.lock): held by a live watcher for its lifetime. - Writer
Lock - The workspace writer lock (
writer.lock), released on drop. - Writer
Lock Options - How long a writer waits, and how often it polls.
Constants§
- WATCH_
LEASE watch.lock.- WRITER_
LOCK writer.lock.
Functions§
- pid_
alive - Whether
pidis alive:kill(pid, 0)succeeds, or fails withEPERM(alive but not ours). - read_
holder_ pid - The holder pid recorded in a lock file, or
Nonewhen the file is missing, unreadable or not{"pid": n}. - with_
writer_ lock - Run
fholding the writer lock; released even whenffails.