mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-03 13:02:09 +02: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:
Notes:
sideshowbarker
2024-07-18 03:08:07 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/478b36c37b8
@@ -200,7 +200,7 @@ void EventLoop::process()
|
||||
// FIXME: 2. If there are no tasks in the event loop's task queues and the WorkerGlobalScope object's closing flag is true, then destroy the event loop, aborting these steps, resuming the run a worker steps described in the Web workers section below.
|
||||
|
||||
// If there are tasks in the queue, schedule a new round of processing. :^)
|
||||
if (!m_task_queue.is_empty() || !m_microtask_queue.is_empty())
|
||||
if (m_task_queue.has_runnable_tasks() || !m_microtask_queue.is_empty())
|
||||
schedule();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user