From a648331e2621b6dd8ef4e43c603854e3fcdf163a Mon Sep 17 00:00:00 2001 From: Robin Burchell Date: Wed, 17 Jul 2019 14:15:13 +0200 Subject: [PATCH] Kernel: Fix a nasty lock bug with exec() Exec doesn't leave through the syscall handler, so it didn't unlock the big_lock. This means that reentering can lock it again, and then another thread could endlessly yield waiting to acquire the lock (futilely). This fixes AudioServer using 100% CPU. --- Kernel/Process.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Kernel/Process.cpp b/Kernel/Process.cpp index 7ce78fadd0..0409299eb7 100644 --- a/Kernel/Process.cpp +++ b/Kernel/Process.cpp @@ -442,6 +442,7 @@ int Process::do_exec(String path, Vector arguments, Vector envir #endif main_thread().set_state(Thread::State::Skip1SchedulerPass); + big_lock().unlock_if_locked(); return 0; }