forked from KolibriOS/kolibrios
newlib: struct dirent
pixlib3: enable linear texture filtration libsync: user space synchronization git-svn-id: svn://kolibrios.org@5602 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
17
contrib/sdk/sources/libsync/m_try.asm
Normal file
17
contrib/sdk/sources/libsync/m_try.asm
Normal file
@@ -0,0 +1,17 @@
|
||||
format MS COFF
|
||||
use32
|
||||
|
||||
MUTEX.lock equ 0
|
||||
MUTEX.handle equ 4
|
||||
|
||||
section '.text' align 16 code readable executable
|
||||
|
||||
public @mutex_trylock@4
|
||||
|
||||
@mutex_trylock@4:
|
||||
mov edx, 1
|
||||
xor eax, eax
|
||||
lock cmpxchg [ecx+MUTEX.lock], edx
|
||||
setz al
|
||||
movzx eax, al
|
||||
ret
|
Reference in New Issue
Block a user