Fn77 - use -2 return value for EWOULDBLOCK.
git-svn-id: svn://kolibrios.org@6089 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
3f61ba72bb
commit
419012b345
@ -132,10 +132,10 @@ align 4
|
||||
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 @@ align 4
|
||||
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 @@ align 4
|
||||
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 @@ align 4
|
||||
test eax, eax
|
||||
jz .timeout
|
||||
|
||||
mov eax, edx
|
||||
lock cmpxchg [ecx], edx
|
||||
jz .again_timeout
|
||||
@@:
|
||||
|
@ -4794,8 +4794,9 @@ Parameters:
|
||||
* 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
|
||||
|
Loading…
Reference in New Issue
Block a user