Rev 8130 | Rev 9709 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 8130 | Rev 8876 | ||
---|---|---|---|
Line 3... | Line 3... | ||
3 | ;; Copyright (C) KolibriOS team 2004-2017. All rights reserved. ;; |
3 | ;; Copyright (C) KolibriOS team 2004-2017. 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: 8130 $ |
8 | $Revision: 8876 $ |
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 131... | Line 131... | ||
131 | lea esi, [ebp+FUTEX.wait_list] |
131 | lea esi, [ebp+FUTEX.wait_list] |
Line 132... | Line 132... | ||
132 | 132 | ||
133 | list_add_tail esp, esi ;esp= new waiter, esi= list head |
133 | list_add_tail esp, esi ;esp= new waiter, esi= list head |
134 | mov eax, edx |
134 | mov eax, edx |
135 | .again: |
135 | .again: |
136 | mov [ebx+TASKDATA.state], 1 |
136 | mov [ebx+TASKDATA.state], TSTATE_RUN_SUSPENDED |
Line 137... | Line 137... | ||
137 | call change_task |
137 | call change_task |
138 | 138 | ||
Line 178... | Line 178... | ||
178 | mov [ebx+APPDATA.wait_timeout], esi |
178 | mov [ebx+APPDATA.wait_timeout], esi |
179 | mov [ebx+APPDATA.wait_param], ebp |
179 | mov [ebx+APPDATA.wait_param], ebp |
180 | mov eax, [timer_ticks] |
180 | mov eax, [timer_ticks] |
181 | mov [ebx+APPDATA.wait_begin], eax |
181 | mov [ebx+APPDATA.wait_begin], eax |
182 | mov eax, [TASK_BASE] |
182 | mov eax, [TASK_BASE] |
183 | mov [eax+TASKDATA.state], 5 |
183 | mov [eax+TASKDATA.state], TSTATE_WAITING |
Line 184... | Line 184... | ||
184 | 184 | ||
185 | mov [esp+MUTEX_WAITER.task], eax |
185 | mov [esp+MUTEX_WAITER.task], eax |
Line 186... | Line 186... | ||
186 | lea esi, [ebp+FUTEX.wait_list] |
186 | lea esi, [ebp+FUTEX.wait_list] |
Line 230... | Line 230... | ||
230 | .again_wake: |
230 | .again_wake: |
231 | cmp esi, ebx |
231 | cmp esi, ebx |
232 | je .done |
232 | je .done |
Line 233... | Line 233... | ||
233 | 233 | ||
234 | mov eax, [esi+MUTEX_WAITER.task] |
234 | mov eax, [esi+MUTEX_WAITER.task] |
Line 235... | Line 235... | ||
235 | mov [eax+TASKDATA.state], 0 |
235 | mov [eax+TASKDATA.state], TSTATE_RUNNING |
236 | 236 | ||
237 | mov esi, [esi+MUTEX_WAITER.list.next] |
237 | mov esi, [esi+MUTEX_WAITER.list.next] |
238 | inc ecx |
238 | inc ecx |