summaryrefslogtreecommitdiff
path: root/lib/xref.h
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@opensourcerouting.org>2023-01-06 16:55:38 +0100
committerDavid Lamparter <equinox@opensourcerouting.org>2023-01-06 16:59:02 +0100
commitccac11096c385d269ecd15ad24ac88d469e7577c (patch)
tree7183e2373105941999c1afedbc3b66a8a1ca6ee7 /lib/xref.h
parentb15826e81bfd9cf8325720abb31e2a7c1261a647 (diff)
zebra: do not load/store wider-than-ptr atomics
Most 32-bit architectures cannot do atomic loads and stores of data wider than their pointer size, i.e. 32 bit. Funnily enough they generally *can* do a CAS2, i.e., 64-bit compare-and-swap, but while a CAS can emulate atomic add/bitops, loads and stores aren't available. Replace with a mutex; since this is 99% used from the zserv thread, the mutex should take the local-to-thread fast path anyway. And while one atomic might be faster than a mutex lock/unlock, we're doing several here, and at some point a mutex wins on speed anyway. This fixes build on armel, mipsel, m68k, powerpc, and sh4. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'lib/xref.h')
0 files changed, 0 insertions, 0 deletions