示例#1
0
        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");
        }
示例#2
0
 public static unsafe uint Decrement(uint *location)
 {
     Asm.LOCK();
     Asm.DEC(location);
     return(*location);
 }