mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-16 04:50:29 +00:00
bgpd: schedule process packet as timer
Different places scheduling the same thread should use the same semantics and thread type. Additionally providing the back reference here makes sure we only schedule the job once and avoids flooding the event queue with jobs to process an empty buffer.
This commit is contained in:
parent
af1e1dc69e
commit
4af766600a
@ -2270,8 +2270,9 @@ int bgp_process_packet(struct thread *thread)
|
||||
{
|
||||
// more work to do, come back later
|
||||
if (peer->ibuf->count > 0)
|
||||
thread_add_event(bm->master, bgp_process_packet,
|
||||
peer, 0, NULL);
|
||||
thread_add_timer_msec(
|
||||
bm->master, bgp_process_packet, peer, 0,
|
||||
&peer->t_process_packet);
|
||||
}
|
||||
pthread_mutex_unlock(&peer->io_mtx);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user