Fixes slow atomic operation possibly overriding newer values.