Skip to content

Commit

Permalink
Merge pull request #12985 from FRRouting/mergify/bp/stable/8.3/pr-11913
Browse files Browse the repository at this point in the history
bgpd: release rcu lock in bgp keepalive pthread (backport #11913)
  • Loading branch information
ton31337 committed Mar 13, 2023
2 parents 331813c + 74d699c commit 65810cc
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions bgpd/bgp_keepalives.c
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,15 @@ void *bgp_keepalives_start(void *arg)
struct timeval next_update = {0, 0};
struct timespec next_update_ts = {0, 0};

/*
* The RCU mechanism for each pthread is initialized in a "locked"
* state. That's ok for pthreads using the frr_pthread,
* thread_fetch event loop, because that event loop unlocks regularly.
* For foreign pthreads, the lock needs to be unlocked so that the
* background rcu pthread can run.
*/
rcu_read_unlock();

peerhash_mtx = XCALLOC(MTYPE_TMP, sizeof(pthread_mutex_t));
peerhash_cond = XCALLOC(MTYPE_TMP, sizeof(pthread_cond_t));

Expand Down

0 comments on commit 65810cc

Please sign in to comment.