mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-02 09:18:52 +00:00
Kernel: Make the colonel run at "Idle" priority (the lowest possible.)
This means it won't hog the CPU for more than a single timeslice. :^)
This commit is contained in:
parent
45a30b4dfa
commit
ec365b82d5
Notes:
sideshowbarker
2024-07-19 14:38:27 +09:00
Author: https://github.com/awesomekling
Commit: ec365b82d5
4 changed files with 12 additions and 4 deletions
|
@ -84,12 +84,14 @@ GVariant ProcessModel::data(const GModelIndex& index, Role role) const
|
|||
case Column::State: return process.current_state.state;
|
||||
case Column::User: return process.current_state.user;
|
||||
case Column::Priority:
|
||||
if (process.current_state.priority == "Low")
|
||||
if (process.current_state.priority == "Idle")
|
||||
return 0;
|
||||
if (process.current_state.priority == "Normal")
|
||||
if (process.current_state.priority == "Low")
|
||||
return 1;
|
||||
if (process.current_state.priority == "High")
|
||||
if (process.current_state.priority == "Normal")
|
||||
return 2;
|
||||
if (process.current_state.priority == "High")
|
||||
return 3;
|
||||
ASSERT_NOT_REACHED();
|
||||
return 3;
|
||||
case Column::Linear: return (int)process.current_state.linear;
|
||||
|
@ -110,6 +112,8 @@ GVariant ProcessModel::data(const GModelIndex& index, Role role) const
|
|||
case Column::State: return process.current_state.state;
|
||||
case Column::User: return process.current_state.user;
|
||||
case Column::Priority:
|
||||
if (process.current_state.priority == "Idle")
|
||||
return String::empty();
|
||||
if (process.current_state.priority == "High")
|
||||
return *m_high_priority_icon;
|
||||
if (process.current_state.priority == "Low")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue