We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 673ef3c commit 71a2ed7Copy full SHA for 71a2ed7
arch/lib/include/asm/atomic.h
@@ -42,7 +42,12 @@ long atomic64_sub_return(long i, atomic64_t *v);
42
#define atomic64_dec_return(v) (atomic64_sub_return(1, (v)))
43
static inline long atomic64_cmpxchg(atomic64_t *v, long old, long new)
44
{
45
- return cmpxchg(&v->counter, old, new);
+ long long val;
46
+
47
+ val = v->counter;
48
+ if (val == old)
49
+ v->counter = new;
50
+ return val;
51
}
52
long atomic64_xchg(atomic64_t *v, long new);
53
int atomic64_add_unless(atomic64_t *v, long a, long u);
0 commit comments