Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 6088 → Rev 6089

/kernel/trunk/core/sync.inc
132,10 → 132,10
jnz .futex_wait_timeout
mov ecx, [ebp+FUTEX.pointer]
mov eax, edx
lock cmpxchg [ecx], edx ;wait until old_value == new_value
jz .wait_slow
lock cmpxchg [ecx], edx
je .wait_slow
 
mov [esp+SYSCALL_STACK._eax], 0
mov [esp+SYSCALL_STACK._eax], -2
ret
 
.wait_slow:
148,13 → 148,13
lea esi, [ebp+FUTEX.wait_list]
 
list_add_tail esp, esi ;esp= new waiter, esi= list head
 
mov eax, edx
.again:
mov [ebx+TASKDATA.state], 1
call change_task
 
lock cmpxchg [ecx], edx
jz .again
je .again
 
list_del esp
add esp, sizeof.MUTEX_WAITER
174,9 → 174,9
mov ecx, [ebp+FUTEX.pointer]
mov eax, edx
lock cmpxchg [ecx], edx ;wait until old_value == new_value
jz .wait_slow_timeout
je .wait_slow_timeout
 
mov [esp+SYSCALL_STACK._eax], 0
mov [esp+SYSCALL_STACK._eax], -2
ret
 
align 4
210,6 → 210,7
test eax, eax
jz .timeout
 
mov eax, edx
lock cmpxchg [ecx], edx
jz .again_timeout
@@:
/kernel/trunk/docs/sysfuncs.txt
4794,8 → 4794,9
* edx = control value
* esi = timeout in system ticks or 0 for infinity
Returned value:
* eax = 0 - successfull, -1 on timeout
 
* eax = 0 - successfull
-1 - timeout
-2 - futex dword does not have the same value as edx
Remarks:
* This functionn tests that the value at the futex dword still
contains the expected control value, and if so, then sleeps