From be9e2b43f330f39d3757de081caf347b6368ad89 Mon Sep 17 00:00:00 2001 From: "Evgeny Grechnikov (Diamond)" Date: Sat, 16 May 2009 09:57:16 +0000 Subject: [PATCH] use atomic bts for mutex in sys_background from Maxis git-svn-id: svn://kolibrios.org@1071 a494cfbc-eb01-0410-851d-a64ba20cac60 --- kernel/trunk/kernel.asm | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/kernel/trunk/kernel.asm b/kernel/trunk/kernel.asm index 733b16bd35..e9adf32572 100644 --- a/kernel/trunk/kernel.asm +++ b/kernel/trunk/kernel.asm @@ -2254,8 +2254,9 @@ sys_cachetodiskette: uglobal ; bgrchanged dd 0x0 -bgrlock db 0 +align 4 bgrlockpid dd 0 +bgrlock db 0 endg sys_background: @@ -2267,10 +2268,9 @@ sys_background: cmp edx,0 je sbgrr @@: - mov al, 1 - xchg [bgrlock], al - test al, al - jz @f +;;Maxis use atomic bts for mutexes 4.4.2009 + bts dword [bgrlock], 0 + jnc @f call change_task jmp @b @@: @@ -2368,11 +2368,10 @@ draw_background_temp: cmp ebx, 6 jnz nosb6 +;;Maxis use atomic bts for mutex 4.4.2009 @@: - mov al, 1 - xchg [bgrlock], al - test al, al - jz @f + bts [bgrlock], 0 + jnc @f call change_task jmp @b @@: