Am I wrong?
Nope, you’re absolutely right – as is your example timeline.
In addition to it not being atomic, it’s not guaranteed that the write to id
will be picked up by the other thread anyway, given that there’s no synchronization and the field isn’t volatile.
It’s somewhat disconcerting for reference material like this to be incorrect 🙁