There's simply no way to get this right without some sort of help
from the kernel.
Why not:
void acquire_lock(lock)
{
repeat:
while(mutex_held(lock))
yield();
if(!mutex_try(lock))
goto repeat;
}
Later,
David S. Miller
davem@caip.rutgers.edu