atomicOp uses a CAS loop for the RMW operations.
Ignore my comment. I should have looked at the code in core.atomic
before commenting. I just had one test case with atomicOp!("+=") that
worked, and assumed that atomicOp!("+=") was implemented with "lock xadd".
I'm thinking of exposing atomicStore and atomicLoad in core.atomic so folks
have something to use until the compiler work is taken care of.
This would be a good solution. Not only does it solve this ordering
issue, but it is actually what I want to do with a shared variable while
I am already within a critical section anyways.