summaryrefslogtreecommitdiff
path: root/lib/frr_pthread.h
diff options
context:
space:
mode:
authorLouis Scalbert <louis.scalbert@6wind.com>2024-02-02 10:25:05 +0100
committerLouis Scalbert <louis.scalbert@6wind.com>2024-02-02 10:25:05 +0100
commit73f72c52668cb402913ac694d91c25ee48cb174a (patch)
treece756c2ede8bbaf125a2d14076ca7a6716bbc1bc /lib/frr_pthread.h
parenta4f222292ba26dd536da6004772341738b1e9be4 (diff)
lib: add ability to log from external pthread
External libraries can re-enter the FRR code through a hook function. A crash occurs when logging from this hook function if the library has initiated a new pthread, as the FRR RCU context is not initialized for this thread. Add frr_pthread_non_controlled_startup() function to initialize a valid RCU context within a FRR pthread context, originating from an external pthread. Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
Diffstat (limited to 'lib/frr_pthread.h')
-rw-r--r--lib/frr_pthread.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/frr_pthread.h b/lib/frr_pthread.h
index f91044dfae..1e1b8d7fd3 100644
--- a/lib/frr_pthread.h
+++ b/lib/frr_pthread.h
@@ -202,6 +202,9 @@ void frr_pthread_stop_all(void);
#define pthread_condattr_setclock(A, B)
#endif
+int frr_pthread_non_controlled_startup(pthread_t thread, const char *name,
+ const char *os_name);
+
/* mutex auto-lock/unlock */
/* variant 1: