Kernel: Process is not reference counted any more

This was not necessary and it made things needlessly complicated
This commit is contained in:
2023-04-19 00:34:18 +03:00
parent 3ca623349a
commit d63716db96
11 changed files with 91 additions and 69 deletions
+5 -5
View File
@@ -27,7 +27,7 @@ namespace Kernel
ASSERT(s_instance == nullptr);
s_instance = new Scheduler();
ASSERT(s_instance);
s_instance->m_idle_thread = TRY(Thread::create([](void*) { for (;;) asm volatile("hlt"); }));
s_instance->m_idle_thread = TRY(Thread::create([](void*) { for (;;) asm volatile("hlt"); }, nullptr, nullptr));
return {};
}
@@ -247,11 +247,11 @@ namespace Kernel
{
VERIFY_CLI();
pid_t pid = m_current_thread->thread->process()->pid();
pid_t pid = m_current_thread->thread->process().pid();
remove_threads(m_blocking_threads, it->thread->process()->pid() == pid);
remove_threads(m_sleeping_threads, it->thread->process()->pid() == pid);
remove_threads(m_active_threads, it != m_current_thread && it->thread->process()->pid() == pid);
remove_threads(m_blocking_threads, it->thread->process().pid() == pid);
remove_threads(m_sleeping_threads, it->thread->process().pid() == pid);
remove_threads(m_active_threads, it != m_current_thread && it->thread->process().pid() == pid);
delete m_current_thread->thread;
remove_and_advance_current_thread();