From: Maria Matejka Date: Sat, 8 Jun 2024 21:43:37 +0000 (+0200) Subject: Task-in-limit checker hacked for mainloop X-Git-Tag: v3.0.0~161 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4bca3b9f868ff0b550b41f3ed3e66738ed274b87;p=thirdparty%2Fbird.git Task-in-limit checker hacked for mainloop --- diff --git a/sysdep/unix/io-loop.c b/sysdep/unix/io-loop.c index ddf190b0f..9d0fa138f 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)