This is part of a large-scale refactoring of our use of atomic memory operations (or, rather, fixing the lack therefore) in the runtime system. See !2642 (merged) for details.
Here we introduce a mutex to protect the statistics tracked in
While on face value this seems a bit heavy, I think it's far better than
enforcing ordering on every access.