1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-20 14:05:08 +00:00

Kernel: Make sure we never put the colonel thread in the runnable list.

This would cause it to get scheduled unnecessarily.
This commit is contained in:
Andreas Kling 2019-05-18 20:24:55 +02:00
parent 64a4f3df69
commit 7900da9667
2 changed files with 6 additions and 1 deletions

View file

@ -546,6 +546,7 @@ bool Thread::is_thread(void* ptr)
void Thread::set_thread_list(InlineLinkedList<Thread>* thread_list)
{
ASSERT(pid() != 0);
if (m_thread_list == thread_list)
return;
if (m_thread_list)
@ -558,5 +559,6 @@ void Thread::set_thread_list(InlineLinkedList<Thread>* thread_list)
void Thread::set_state(State new_state)
{
m_state = new_state;
set_thread_list(thread_list_for_state(new_state));
if (m_process.pid() != 0)
set_thread_list(thread_list_for_state(new_state));
}