This commit is contained in:
Russ Cox
2005-11-04 15:57:52 +00:00
parent e10503f019
commit f493c9c544
3 changed files with 44 additions and 60 deletions

View File

@ -1,22 +0,0 @@
// could also use windozy InterlockedCompareExchange(p, 1, 0), but why
int
tas(long *p)
{
int v;
_asm {
mov eax, p
mov ebx, 1
xchg ebx, [eax]
mov v, ebx
}
switch(v) {
case 0:
case 1:
return v;
default:
print("canlock: corrupted 0x%lux\n", v);
return 1;
}
}