StupidOS/kernel/lock.inc
2024-07-07 15:29:41 +02:00

17 lines
145 B
PHP

;;
lock_acquire:
lock bts [eax], 0
jnc .end
@@:
pause
test [eax], 1
jne @b
lock bts [eax], 0
jc @b
.end:
ret
release:
mov [eax], 0