0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-12-22 09:41:54 +00:00

Never allow more than 300 ms per loop

This commit is contained in:
Maria Matejka 2024-05-31 21:22:07 +02:00
parent 7a169e46a8
commit 2705c385c0

View File

@ -817,7 +817,11 @@ bird_thread_main(void *arg)
/* Compute maximal time per loop */
u64 thr_before_run = ns_now();
if (thr->loop_count > 0)
{
thr->max_loop_time_ns = (thr->max_latency_ns / 2 - (thr_before_run - thr_loop_start)) / (u64) thr->loop_count;
if (thr->max_loop_time_ns > 300 MS)
thr->max_loop_time_ns = 300 MS;
}
/* Run all scheduled loops */
int more_events = ev_run_list(&thr->meta->event_list);