>>547

何で、ループを二つも作る ?

__inline void lock(volatile int *ptr)
{
_asm {
L0:
mov eax, 1
xchg eax, [ecx]
test eax, eax
jnz L0:
}
}

だけでいいと思うが...。