Commit Graph

8 Commits

Author SHA1 Message Date
David Lamparter
4836ac0714 tests: silence TSAN warning on test_seqlock exit
TSAN warns about leaving the second thread dangling.  Doesn't really
matter, but just add a pthread_join to get rid of the warning.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2024-06-20 11:16:10 +02:00
David Lamparter
8aeac1f005 tests/lib: fix seqlock test
seqlock_bump() used to return the value before bumping, but that's
unhelpful if you were to actually need it.  I had changed it to return
the value after, but the update to the test got lost at some point.

The return value is not in fact used anywhere in FRR, so while it is
a bug, it has zero impact.

NB: yes, test_seqlock is not run, which sounds wrong.  The problem here
is that (a) the test itself uses sleeps and is timing sensitive, which
would raise false positives.  And (b), the test is meaningless if
executed once.  It needs to be run millions of times under various
conditions (e.g. load) to catch rare races, and it needs to be run on
machines with "odd" memory models (in this case I used BE ppc32 and
ppc64 systems as test platforms.)

Fixes: 6046b690b5 ("lib/seqlock: avoid syscalls in no-waiter cases")
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2024-06-20 11:02:19 +02:00
David Lamparter
cca918fe04 *: remove some leftover license blurbs
The regex'ing left some paragraphs that didn't exactly match.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-02-09 14:09:11 +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
8dff30f801 tests: fix assert.h header change fallout
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-05-02 16:27:17 +02:00
David Lamparter
6046b690b5 lib/seqlock: avoid syscalls in no-waiter cases
When we have no contention on the seqlock, we shouldn't incur the cost
of syscalls.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2019-07-31 03:33:41 +02:00
David Lamparter
2618a52ed3 *: config.h or zebra.h is the first #include
This is mostly relevant for Solaris, where config.h sets up some #define
that affect overall header behaviour, so it needs to be before anything
else.

Signed-off-by: David Lamparter <equinox@diac24.net>
2019-06-13 13:35:33 +02:00
David Lamparter
440d5faa3a lib: add "seqlock" wait/broadcast primitive
Manually tested rather extensively in addition to included unit tests,
should work as intended.

NB: The OpenBSD futex() code is "future"; it's not actually in OpenBSD
(yet?) and thus untested.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2019-04-18 12:44:29 +02:00