mirror of
https://github.com/Qortal/Brooklyn.git
synced 2025-01-30 23:02:18 +00:00
12 lines
250 B
Plaintext
12 lines
250 B
Plaintext
cat <<EOF
|
|
static __always_inline bool
|
|
arch_${atomic}_try_cmpxchg${order}(${atomic}_t *v, ${int} *old, ${int} new)
|
|
{
|
|
${int} r, o = *old;
|
|
r = arch_${atomic}_cmpxchg${order}(v, o, new);
|
|
if (unlikely(r != o))
|
|
*old = r;
|
|
return likely(r == o);
|
|
}
|
|
EOF
|