1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 18:57:45 +00:00

Kernel: Rework Process::Priority into ThreadPriority

Scheduling priority is now set at the thread level instead of at the
process level.

This is a step towards allowing processes to set different priorities
for threads. There's no userspace API for that yet, since only the main
thread's priority is affected by sched_setparam().
This commit is contained in:
Andreas Kling 2019-11-06 16:26:51 +01:00
parent e33bbdb6ba
commit 083c5f8b89
7 changed files with 46 additions and 46 deletions

View file

@ -170,7 +170,7 @@ VFS* vfs;
kprintf("init_stage2: error spawning Shell: %d\n", error);
hang();
}
shell_process->set_priority(Process::HighPriority);
shell_process->main_thread().set_priority(ThreadPriority::High);
} else {
tty0->set_graphical(true);
auto* system_server_process = Process::create_user_process("/bin/SystemServer", (uid_t)0, (gid_t)0, (pid_t)0, error, {}, {}, tty0);
@ -178,7 +178,7 @@ VFS* vfs;
kprintf("init_stage2: error spawning SystemServer: %d\n", error);
hang();
}
system_server_process->set_priority(Process::HighPriority);
system_server_process->main_thread().set_priority(ThreadPriority::High);
}
Process::create_kernel_process("NetworkTask", NetworkTask_main);
@ -313,7 +313,7 @@ extern "C" [[noreturn]] void init()
});
Process::create_kernel_process("Finalizer", [] {
g_finalizer = current;
current->process().set_priority(Process::LowPriority);
current->set_priority(ThreadPriority::Low);
for (;;) {
Thread::finalize_dying_threads();
(void)current->block<Thread::SemiPermanentBlocker>(Thread::SemiPermanentBlocker::Reason::Lurking);