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