Migrating atomic ops to std::atomic where possible and poly.