summaryrefslogtreecommitdiff
path: root/lib/xref.h
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@opensourcerouting.org>2023-01-06 16:55:38 +0100
committerMergify <37929162+mergify[bot]@users.noreply.github.com>2023-01-09 18:27:01 +0000
commit00624c9564457eb62adcd908b310f4df65b0efe5 (patch)
tree01923bcadf371de365f94504477e8aef5a11b140 /lib/xref.h
parentc2853adde61305528383ea656852bf55a83d82f6 (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> (cherry picked from commit ccac11096c385d269ecd15ad24ac88d469e7577c)
Diffstat (limited to 'lib/xref.h')
0 files changed, 0 insertions, 0 deletions