]> git.puffer.fish Git - matthieu/frr.git/commit
lib: add ability to log from external pthread
authorLouis Scalbert <louis.scalbert@6wind.com>
Fri, 2 Feb 2024 09:25:05 +0000 (10:25 +0100)
committerLouis Scalbert <louis.scalbert@6wind.com>
Fri, 2 Feb 2024 09:25:05 +0000 (10:25 +0100)
commit73f72c52668cb402913ac694d91c25ee48cb174a
treece756c2ede8bbaf125a2d14076ca7a6716bbc1bc
parenta4f222292ba26dd536da6004772341738b1e9be4
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>
lib/frr_pthread.c
lib/frr_pthread.h
lib/frrcu.c
lib/frrcu.h