Expand description
Single-writer ownership via a process-local registry and an OS file lock.
Two mechanisms are needed, because neither alone is sufficient:
- The process-local registry provides same-process exclusion. POSIX
record locks do not conflict between descriptors held by one process, and
Windows byte-range locks likewise do not conflict with the process that
already owns them, so without the registry a second
Storein the same process would be admitted. - The persistent
writer.lockprovides cross-process exclusion and is released by the operating system when the holder dies, orderly or not.
The registry is keyed on the store directory’s stable filesystem identity —
(st_dev, st_ino) on Unix, (volume serial, file index) on Windows — never
on path text, so case differences, separator differences, relative versus
absolute spellings and supported junctions all converge on one store.
Nothing else in this process may open STORE_LOCK_FILE.
Structs§
- Store
Lock - Exclusive writer ownership automatically released when the process dies.
Enums§
- Store
Lock Error - Failure to open or acquire the single-writer lock.
Constants§
- STORE_
LOCK_ FILE - Persistent lock filename; only
StoreLockmay open this file.