diff options
author | Boqun Feng <boqun.feng@gmail.com> | 2025-09-04 21:41:32 -0700 |
---|---|---|
committer | Peter Zijlstra <peterz@infradead.org> | 2025-09-15 09:38:33 +0200 |
commit | b606a532c01380ac282fd0a0858e3e8ea01ad904 (patch) | |
tree | 0a1244c81305c5007cd44982a8af8af52267cb2f /rust/helpers/slab.c | |
parent | 29c32c405e53605dfd24054a4460516f7f6e3938 (diff) |
rust: sync: atomic: Add atomic {cmp,}xchg operations
xchg() and cmpxchg() are basic operations on atomic. Provide these based
on C APIs.
Note that cmpxchg() use the similar function signature as
compare_exchange() in Rust std: returning a `Result`, `Ok(old)` means
the operation succeeds and `Err(old)` means the operation fails.
Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Reviewed-by: Benno Lossin <lossin@kernel.org>
Reviewed-by: Elle Rhumsaa <elle@weathered-steel.dev>
Link: https://lore.kernel.org/all/20250719030827.61357-6-boqun.feng@gmail.com/
Diffstat (limited to 'rust/helpers/slab.c')
0 files changed, 0 insertions, 0 deletions