ensure-stores-after-memory
is a synchronization function which ensures order of memory between operations in different threads.
See Ensuring order of memory between operations in different threads for a full description and example.
You should have a good understanding of multiprocessing issues at the CPU level to write code that actually needs this.