summaryrefslogtreecommitdiff
path: root/Kernel
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-02-25 19:30:27 +0100
committerAndreas Kling <kling@serenityos.org>2021-02-25 19:36:36 +0100
commit4aa58aaab53d0cf3ff8f60512c36757f4b233e5f (patch)
tree51989d255a7bb90840667a70a0dc41a9d78858be /Kernel
parent8eeb8db2ed4a8fa915c4ade39e079546e070e92f (diff)
downloadserenity-4aa58aaab53d0cf3ff8f60512c36757f4b233e5f.zip
Kernel: Don't disable interrupts while exiting a thread or process
This was another vestige from a long time ago, when exiting a thread would mutate global data structures that were only protected by the interrupt flag.
Diffstat (limited to 'Kernel')
-rw-r--r--Kernel/Syscall.cpp1
-rw-r--r--Kernel/Syscalls/exit.cpp2
-rw-r--r--Kernel/Syscalls/thread.cpp1
3 files changed, 0 insertions, 4 deletions
diff --git a/Kernel/Syscall.cpp b/Kernel/Syscall.cpp
index fbf14b1cb9..47db964964 100644
--- a/Kernel/Syscall.cpp
+++ b/Kernel/Syscall.cpp
@@ -101,7 +101,6 @@ int handle(RegisterState& regs, u32 function, u32 arg1, u32 arg2, u32 arg3)
process.tracer_trap(*current_thread, regs); // this triggers SIGTRAP and stops the thread!
}
- cli();
if (function == SC_exit)
process.sys$exit((int)arg1);
else
diff --git a/Kernel/Syscalls/exit.cpp b/Kernel/Syscalls/exit.cpp
index cd127649d7..78fcd4cd04 100644
--- a/Kernel/Syscalls/exit.cpp
+++ b/Kernel/Syscalls/exit.cpp
@@ -31,8 +31,6 @@ namespace Kernel {
void Process::sys$exit(int status)
{
- cli();
-
m_termination_status = status;
m_termination_signal = 0;
die();
diff --git a/Kernel/Syscalls/thread.cpp b/Kernel/Syscalls/thread.cpp
index 90b242ce0c..aa8be5aac5 100644
--- a/Kernel/Syscalls/thread.cpp
+++ b/Kernel/Syscalls/thread.cpp
@@ -98,7 +98,6 @@ int Process::sys$create_thread(void* (*entry)(void*), Userspace<const Syscall::S
void Process::sys$exit_thread(Userspace<void*> exit_value)
{
REQUIRE_PROMISE(thread);
- cli();
if (this->thread_count() == 1) {
// If this is the last thread, instead kill the process.