Commit b1ad6063 authored by Jonas Termansen's avatar Jonas Termansen

Fix system calls panicing when creating threads in the kernel process.

This fixes a regression in 62bd9bf9.
parent 9d29e96c
......@@ -131,8 +131,11 @@ Thread* CreateKernelThread(Process* process, struct thread_registers* regs)
// thread. This requirement is because kthread_exit() needs to know when
// it's the last thread in the process (using threads_not_exiting_count),
// and that no more threads will appear, so it can run some final process
// termination steps without any interference.
assert(!process->firstthread || process == CurrentProcess());
// termination steps without any interference. It's always allowed to create
// threads in the kernel process as it never exits.
assert(!process->firstthread ||
process == CurrentProcess() ||
process == Scheduler::GetKernelProcess());
Thread* thread = AllocateThread();
if ( !thread )
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment