Subversion Repositories Kolibri OS

Rev

Rev 1038 | Rev 1074 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1038 Rev 1072
Line 3... Line 3...
3
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;;
3
;; Copyright (C) KolibriOS team 2004-2007. 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: 1038 $
8
$Revision: 1072 $
Line 9... Line 9...
9
 
9
 
Line 916... Line 916...
916
; param
916
; param
917
;  ebx=mutex
917
;  ebx=mutex
Line 918... Line 918...
918
 
918
 
919
align 4
919
align 4
-
 
920
wait_mutex:
920
wait_mutex:
921
;;Maxis use atomic bts for mutex 4.4.2009
921
	   push eax
922
	   push eax
922
	   push ebx
923
	   push ebx
923
.do_wait:
924
.do_wait:
924
	   cmp dword [ebx],0
925
           bts dword [ebx],0
925
	   je .get_lock
926
           jnc .locked
926
	   call change_task
927
	   call change_task
927
	   jmp .do_wait
928
	   jmp .do_wait
928
.get_lock:
-
 
929
	   mov eax, 1
-
 
930
	   xchg eax, [ebx]
-
 
931
	   test eax, eax
-
 
932
	   jnz .do_wait
929
.locked:
933
	   pop ebx
930
	   pop ebx
934
	   pop eax
931
	   pop eax
Line 935... Line 932...
935
	   ret
932
	   ret