Subversion Repositories Kolibri OS

Rev

Rev 9869 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 9869 Rev 9871
Line 3... Line 3...
3
;; Copyright (C) KolibriOS team 2004-2022. All rights reserved. ;;
3
;; Copyright (C) KolibriOS team 2004-2022. All rights reserved. ;;
4
;;  Distributed under terms of the GNU General Public License.  ;;
4
;;  Distributed under terms of the GNU General Public License.  ;;
5
;;                                                              ;;
5
;;                                                              ;;
6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Line 7... Line 7...
7
 
7
 
Line 8... Line 8...
8
$Revision: 9869 $
8
$Revision: 9871 $
9
 
9
 
10
align 4
10
align 4
11
;struct futex*  __fastcall create_futex(int *ptr)
11
;struct futex*  __fastcall create_futex(int *ptr)
Line 183... Line 183...
183
 
183
 
184
        mov     [esp + MUTEX_WAITER.task], ebx
184
        mov     [esp + MUTEX_WAITER.task], ebx
Line 185... Line 185...
185
        lea     esi, [ebp + FUTEX.wait_list]
185
        lea     esi, [ebp + FUTEX.wait_list]
186
 
-
 
187
        list_add_tail esp, esi      ;esp= new waiter, esi= list head
186
 
-
 
187
        list_add_tail esp, esi      ;esp= new waiter, esi= list head
188
        sti
188
.again_timeout:
189
.again_timeout:
189
        mov     [ebx + APPDATA.state], TSTATE_WAITING
190
        call    change_task
190
        call    change_task
191
        mov     eax, [ebx + APPDATA.wait_param]
191
        mov     eax, [ebx + APPDATA.wait_param]
192
        test    eax, eax
-
 
193
        jz      .timeout
192
        test    eax, eax
194
        DEBUGF  1, "FUTEX no timeout [ecx]=%x edx=%x\n", [ecx], edx
193
        jz      .timeout
195
        mov     eax, edx
194
        mov     eax, edx
196
        lock cmpxchg [ecx], edx
195
        lock cmpxchg [ecx], edx
197
        jz      .again_timeout
196
        jz      .again_timeout
Line 203... Line 202...
203
        popfd
202
        popfd
204
        mov     [esp + SYSCALL_STACK.eax], 0
203
        mov     [esp + SYSCALL_STACK.eax], 0
205
        ret
204
        ret
Line 206... Line 205...
206
 
205
 
207
.timeout:
-
 
208
        cli
206
.timeout:
209
        list_del esp
-
 
210
        sti
207
        list_del esp
211
        add     esp, sizeof.MUTEX_WAITER
-
 
212
        DEBUGF  1, "FUTEX timeout\n"
208
        add     esp, sizeof.MUTEX_WAITER
213
        popfd
209
        popfd
214
        mov     [esp + SYSCALL_STACK.eax], -1
210
        mov     [esp + SYSCALL_STACK.eax], -1