disable poll (0) if there's a foreground task

This commit is contained in:
Karl Seguin committed 2026-09-28 06:36:30 +08:00
1 parent 43d384d676
commit 52cb8cf47b
1 file changed
+3
+3
View File
@@ -317,6 +317,9 @@ fn _tick(self: *Runner, comptime is_cdp: bool, timeout_ms: u32, conditions: []Wa
if (has_runnable_page == false) {
break :blk 200;
}
if (browser.foreground_task_posted.load(.acquire)) {
break :blk 0;
}
break :blk browser.msToNextTask() orelse 200;
};
const ms_to_wait = @min(timeout_ms, ms_to_next_task);