Commit graph

9 commits

Author SHA1 Message Date
David Lamparter 1f67dfb143 lib: fix typo in rcu_do()
I lost an underscore somewhere along the way.  Which never caused issues
because we don't use that function macro.  It is, however, useful for
testing, so fix it.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2024-06-20 11:04:09 +02:00
Louis Scalbert 73f72c5266 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>
2024-02-02 10:25:05 +01:00
David Lamparter acddc0ed3c *: auto-convert to SPDX License IDs
Done with a combination of regex'ing and banging my head against a wall.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-02-09 14:09:11 +01:00
David Lamparter 8d4e934b08 lib: avoid include loop with assert.h
`assert.h` -> `xref.h` -> `typesafe.h` -> `assert.h`

Might be possible to do this more cleanly some way, but that way is not
obvious, so here's the "simple & dumb" approach.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-11-10 12:36:50 +01:00
David Lamparter 960b9a5383 *: require semicolon after DEFINE_<typesafe...>
Again, see previous commits.

Signed-off-by: David Lamparter <equinox@diac24.net>
2021-03-17 06:18:39 +01:00
Renato Westphal 17e38209a5 lib, zebra: add missing extern "C" {} blocks to new header files
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2020-04-22 23:49:22 -03:00
David Lamparter 6127ec9752 lib/frrcu: make C++ compatible
... by dropping seqlock.h from the header's includes;  it's only needed
in the C code in frrcu.c.

Signed-off-by: David Lamparter <equinox@diac24.net>
2020-04-21 21:38:07 +02:00
David Lamparter 9fe602a17c lib: make rcu_free() NULL-safe
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2019-12-13 06:22:34 +01:00
David Lamparter 3e41733f1b lib: RCU
Please refer to doc/developer/rcu.rst for documentation.

Signed-off-by: David Lamparter <equinox@diac24.net>
2019-07-31 03:34:09 +02:00