mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 05:07:35 +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:
parent
e33bbdb6ba
commit
083c5f8b89
7 changed files with 46 additions and 46 deletions
|
@ -34,6 +34,15 @@ struct ThreadSpecificData {
|
|||
ThreadSpecificData* self;
|
||||
};
|
||||
|
||||
enum class ThreadPriority : u8 {
|
||||
Idle,
|
||||
Low,
|
||||
Normal,
|
||||
High,
|
||||
First = Idle,
|
||||
Last = High,
|
||||
};
|
||||
|
||||
class Thread {
|
||||
friend class Process;
|
||||
friend class Scheduler;
|
||||
|
@ -51,6 +60,9 @@ public:
|
|||
int tid() const { return m_tid; }
|
||||
int pid() const;
|
||||
|
||||
void set_priority(ThreadPriority p) { m_priority = p; }
|
||||
ThreadPriority priority() const { return m_priority; }
|
||||
|
||||
Process& process() { return m_process; }
|
||||
const Process& process() const { return m_process; }
|
||||
|
||||
|
@ -341,6 +353,7 @@ private:
|
|||
Blocker* m_blocker { nullptr };
|
||||
FPUState* m_fpu_state { nullptr };
|
||||
State m_state { Invalid };
|
||||
ThreadPriority m_priority { ThreadPriority::Normal };
|
||||
bool m_has_used_fpu { false };
|
||||
bool m_dump_backtrace_on_finalization { false };
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue