From 5ddf2aaa52e9f8977e902e437dd2036604ec7097 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Sat, 3 Feb 2024 21:34:02 -0500 Subject: [PATCH] lib: Actually create the rcu and save it before using it In a non-controlled startup, the rcu data structures were not being created until after logging could happen. This is bad. Move it so that the rcu data structures are created first, before logging( HA! ) can happen. Signed-off-by: Donald Sharp --- lib/frr_pthread.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/frr_pthread.c b/lib/frr_pthread.c index f7e57136d6..1ffa5934aa 100644 --- a/lib/frr_pthread.c +++ b/lib/frr_pthread.c @@ -234,6 +234,10 @@ static void *frr_pthread_attr_non_controlled_start(void *arg) int frr_pthread_non_controlled_startup(pthread_t thread, const char *name, const char *os_name) { + struct rcu_thread *rcu_thread = rcu_thread_new(NULL); + + rcu_thread_start(rcu_thread); + struct frr_pthread_attr attr = { .start = frr_pthread_attr_non_controlled_start, .stop = frr_pthread_attr_default.stop, @@ -245,7 +249,7 @@ int frr_pthread_non_controlled_startup(pthread_t thread, const char *name, return -1; fpt->thread = thread; - fpt->rcu_thread = rcu_thread_new(NULL); + fpt->rcu_thread = rcu_thread; frr_pthread_inner(fpt); return 0; -- 2.39.5