Peek whether spinlock is locked or not
Posted: Sun May 25, 2014 3:31 am
Here's wiki about this http://wiki.osdev.org/Spinlock:
However, to communicate with C, isn't it better?
My question is whether it is okay or not.. I'm afraid whether there's any point I missed..
Code: Select all
cmp dword [lock],0
je .free
jne .locked
Code: Select all
ckSpinlockPeek: ; bool ckSpinlockPeek(Spinlock *pSpinlock);
mov eax, [esp + 4]
mov eax, dword [eax]
ret