summaryrefslogtreecommitdiff
path: root/rust/helpers/mutex.c
diff options
context:
space:
mode:
authorBoqun Feng <boqun.feng@gmail.com>2025-09-04 21:41:32 -0700
committerPeter Zijlstra <peterz@infradead.org>2025-09-15 09:38:33 +0200
commitb606a532c01380ac282fd0a0858e3e8ea01ad904 (patch)
tree0a1244c81305c5007cd44982a8af8af52267cb2f /rust/helpers/mutex.c
parent29c32c405e53605dfd24054a4460516f7f6e3938 (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/mutex.c')
0 files changed, 0 insertions, 0 deletions