SharedHap.ensureState

private void ensureState() @safe nothrow

Create the shared state on first use, publishing it atomically.

Racing callers each allocate a candidate, but exactly one candidate wins the compare-and-swap; every caller leaves with the same published state, so no attached handler can be lost to the race.