public static void SpinWait(int iterations) { if (iterations <= 0) { return; } Asm.MOV(R32.EAX, (uint *)&iterations); Asm.LABEL("SpinWait"); Asm.PAUSE(); Asm.DEC(R32.EAX); Asm.JNC("SpinWait"); }
public static unsafe uint Decrement(uint *location) { Asm.LOCK(); Asm.DEC(location); return(*location); }