mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 09:48:11 +00:00
LibWeb: Only auto-reschedule HTML::EventLoop when there are runnables
HTML::EventLoop tries to reschedule itself when there are more tasks in any of its queues, but let's not do it if none of them are runnable.
This commit is contained in:
parent
38a732a202
commit
478b36c37b
3 changed files with 12 additions and 1 deletions
|
@ -33,4 +33,13 @@ OwnPtr<Task> TaskQueue::take_first_runnable()
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
bool TaskQueue::has_runnable_tasks() const
|
||||
{
|
||||
for (auto& task : m_tasks) {
|
||||
if (task->is_runnable())
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue