mirror of
https://gitlab.nic.cz/labs/bird.git
synced 2025-01-18 06:51:54 +00:00
Never allow more than 300 ms per loop
This commit is contained in:
parent
7a169e46a8
commit
2705c385c0
@ -817,7 +817,11 @@ bird_thread_main(void *arg)
|
|||||||
/* Compute maximal time per loop */
|
/* Compute maximal time per loop */
|
||||||
u64 thr_before_run = ns_now();
|
u64 thr_before_run = ns_now();
|
||||||
if (thr->loop_count > 0)
|
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;
|
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 */
|
/* Run all scheduled loops */
|
||||||
int more_events = ev_run_list(&thr->meta->event_list);
|
int more_events = ev_run_list(&thr->meta->event_list);
|
||||||
|
Loading…
Reference in New Issue
Block a user