2 ms·You need some form of barrier (lock/mfence/cpuid) prior to compare instruction to make the snippet correct.by xxs 6y agoYou need some form of barrier (lock/mfence/cpuid) prior to compare instruction to make the snippet correct.