summaryrefslogtreecommitdiff
path: root/Kernel
diff options
context:
space:
mode:
authorRobin Burchell <robin+git@viroteck.net>2019-07-17 14:15:13 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-07-17 14:23:15 +0200
commita648331e2621b6dd8ef4e43c603854e3fcdf163a (patch)
tree2e80f1c9713597531dc4a09e80c1ee738cf66a65 /Kernel
parentadeead24a3892e21fc19603bc5cb5abe57b181ca (diff)
downloadserenity-a648331e2621b6dd8ef4e43c603854e3fcdf163a.zip
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.
Diffstat (limited to 'Kernel')
-rw-r--r--Kernel/Process.cpp1
1 files changed, 1 insertions, 0 deletions
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<String> arguments, Vector<String> envir
#endif
main_thread().set_state(Thread::State::Skip1SchedulerPass);
+ big_lock().unlock_if_locked();
return 0;
}