Figure 3-2.

A diagram showing happens-before relationships of the example code.

Six boxes are shown.

Five of these form a line and represent the operations of the main thread. They are labeled: store 1 to X, spawn, store 2 to X, join, and store 3 to X. There is an arrow from each of these boxes to the next.

The sixth box is separated from the other five. It represents the operation on the spawned thread. It is labeled: load from X. An arrow goes from “spawn” to this box, and from this box to “join”.

There are no other arrows. So, the arrows do not indicate whether the the sixth box (the load operation), comes before or after the middle box (store 2 to X) on the main thread.