mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 19: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:
parent
e33bbdb6ba
commit
083c5f8b89
7 changed files with 46 additions and 46 deletions
|
@ -44,15 +44,6 @@ public:
|
|||
static Vector<pid_t> all_pids();
|
||||
static Vector<Process*> all_processes();
|
||||
|
||||
enum Priority : u8 {
|
||||
IdlePriority,
|
||||
FirstPriority = IdlePriority,
|
||||
LowPriority,
|
||||
NormalPriority,
|
||||
HighPriority,
|
||||
LastPriority = HighPriority,
|
||||
};
|
||||
|
||||
enum RingLevel : u8 {
|
||||
Ring0 = 0,
|
||||
Ring3 = 3,
|
||||
|
@ -75,9 +66,6 @@ public:
|
|||
|
||||
static Process* from_pid(pid_t);
|
||||
|
||||
void set_priority(Priority p) { m_priority = p; }
|
||||
Priority priority() const { return m_priority; }
|
||||
|
||||
const String& name() const { return m_name; }
|
||||
pid_t pid() const { return m_pid; }
|
||||
pid_t sid() const { return m_sid; }
|
||||
|
@ -351,7 +339,6 @@ private:
|
|||
Vector<FileDescriptionAndFlags> m_fds;
|
||||
|
||||
RingLevel m_ring { Ring0 };
|
||||
Priority m_priority { NormalPriority };
|
||||
u8 m_termination_status { 0 };
|
||||
u8 m_termination_signal { 0 };
|
||||
|
||||
|
@ -429,7 +416,7 @@ private:
|
|||
Process& m_process;
|
||||
};
|
||||
|
||||
extern const char* to_string(Process::Priority);
|
||||
const char* to_string(ThreadPriority);
|
||||
|
||||
extern InlineLinkedList<Process>* g_processes;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue