Grab the count of streams in ibuf when it is protected
by a mutex. Since this data is written to it in another
pthread.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit
f94ad538cf93d2b18fa4181e8508f08f94f0a2cc)
* for systems where we are heavily loaded for one
* reason or another.
*/
- inq_count = atomic_load_explicit(&connection->ibuf->count,
- memory_order_relaxed);
+ frr_with_mutex (&connection->io_mtx) {
+ inq_count = atomic_load_explicit(&connection->ibuf->count, memory_order_relaxed);
+ }
if (inq_count)
BGP_TIMER_ON(connection->t_holdtime, bgp_holdtime_timer,
peer->v_holdtime);