From 4bca3b9f868ff0b550b41f3ed3e66738ed274b87 Mon Sep 17 00:00:00 2001 From: Maria Matejka Date: Sat, 8 Jun 2024 23:43:37 +0200 Subject: [PATCH] Task-in-limit checker hacked for mainloop --- sysdep/unix/io-loop.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sysdep/unix/io-loop.c b/sysdep/unix/io-loop.c index ddf190b0..9d0fa138 100644 --- a/sysdep/unix/io-loop.c +++ b/sysdep/unix/io-loop.c @@ -1358,7 +1358,11 @@ cmd_show_threads(int show_loops) _Bool task_still_in_limit(void) { - return ns_now() < account_last + this_thread->max_loop_time_ns; + static u64 main_counter = 0; + if (this_birdloop == &main_birdloop) + return (++main_counter % 2048); /* This is a hack because of no accounting in mainloop */ + else + return ns_now() < account_last + this_thread->max_loop_time_ns; } _Bool task_before_halftime(void)