From 36115aba3fb9a52f9499251f2d85e99311be7339 Mon Sep 17 00:00:00 2001 From: "Marat Zakiyanov (Mario79)" Date: Wed, 21 Mar 2012 22:48:54 +0000 Subject: [PATCH] Using the new mutex to r.2486 git-svn-id: svn://kolibrios.org@2489 a494cfbc-eb01-0410-851d-a64ba20cac60 --- kernel/trunk/core/dll.inc | 21 +++++---------------- kernel/trunk/kernel.asm | 3 +++ 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/kernel/trunk/core/dll.inc b/kernel/trunk/core/dll.inc index 93d7740f74..43524d190e 100644 --- a/kernel/trunk/core/dll.inc +++ b/kernel/trunk/core/dll.inc @@ -438,23 +438,12 @@ proc load_file stdcall, file_name:dword mov [file2], eax - push eax -.wait_lock: - cmp [unpack_mutex], 0 - je .get_lock - call change_task - jmp .wait_lock - -.get_lock: - mov eax, 1 - xchg eax, [unpack_mutex] - test eax, eax - jnz .wait_lock - pop eax + mov ecx, unpack_mutex + call mutex_lock stdcall unpack, [file], eax - mov [unpack_mutex], 0 + call mutex_unlock stdcall kernel_free, [file] mov eax, [file2] @@ -485,9 +474,9 @@ proc load_file stdcall, file_name:dword ret endp -iglobal +uglobal align 4 -unpack_mutex dd 0 +unpack_mutex MUTEX endg align 4 diff --git a/kernel/trunk/kernel.asm b/kernel/trunk/kernel.asm index 1a317afda5..80fb2594da 100644 --- a/kernel/trunk/kernel.asm +++ b/kernel/trunk/kernel.asm @@ -332,6 +332,9 @@ high_code: mov ecx, disk_list_mutex call mutex_init + mov ecx, unpack_mutex + call mutex_init + ; SAVE REAL MODE VARIABLES mov ax, [BOOT_VAR + BOOT_IDE_BASE_ADDR] mov [IDEContrRegsBaseAddr], ax