diff options
author | Andreas Kling <awesomekling@gmail.com> | 2018-10-25 10:33:10 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2018-10-25 10:33:10 +0200 |
commit | ce126120d160a60b1440e0d7e446bddeff19bace (patch) | |
tree | d9613d769c858da41b6ddcc9cbc8d88992a61688 /Kernel | |
parent | 1c49b34b93bbbdf9a539d786f9560caaf523ab6a (diff) | |
download | serenity-ce126120d160a60b1440e0d7e446bddeff19bace.zip |
Add a few more InterruptDisablers.
Diffstat (limited to 'Kernel')
-rw-r--r-- | Kernel/Task.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Kernel/Task.cpp b/Kernel/Task.cpp index 0ef0831070..9949786d20 100644 --- a/Kernel/Task.cpp +++ b/Kernel/Task.cpp @@ -102,6 +102,7 @@ void Task::allocateLDT() Vector<Task*> Task::allTasks() { + InterruptDisabler disabler; Vector<Task*> tasks; tasks.ensureCapacity(s_tasks->sizeSlow()); for (auto* task = s_tasks->head(); task; task = task->next()) @@ -441,7 +442,8 @@ void Task::sys$exit(int status) void Task::taskDidCrash(Task* crashedTask) { - // NOTE: This is called from an excepton handler, so interrupts are disabled. + ASSERT_INTERRUPTS_DISABLED(); + crashedTask->setState(Crashing); crashedTask->dumpRegions(); @@ -499,6 +501,8 @@ void switchNow() bool scheduleNewTask() { + ASSERT_INTERRUPTS_DISABLED(); + if (!current) { // XXX: The first ever context_switch() goes to the idle task. // This to setup a reliable place we can return to. @@ -801,6 +805,7 @@ pid_t Task::sys$getpid() pid_t Task::sys$waitpid(pid_t waitee) { + InterruptDisabler disabler; if (!Task::fromPID(waitee)) return -1; m_waitee = waitee; |