Expand description
SharedOnceCell<T> - cross-process init-once cell.
State machine:
- EMPTY (0): no value; first writer to CAS to INITIALIZING wins.
- INITIALIZING (1): a writer is filling the payload; other writers spin until state advances.
- INITIALIZED (2): payload is stable; readers may consume.
The winner of the EMPTY -> INITIALIZING CAS performs the write and advances to INITIALIZED. Losers see INITIALIZED and read the winner’s bytes.
This is the cross-process analog of once_cell::sync::OnceCell,
with cross-process safety guaranteed by the atomic CAS protocol
over shared memory.