atomic64_xchg_acquire(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… atomic64_xchg_acquire β€” atomic exchange with acquire ordering ✨

okay bestie, welcome to the Kernel API Manual πŸŽ€ this one's a little function with big main-character energy, and it's literally in the kernel, so let's get into it πŸ’–


🌸 NAME 🌸

atomic64_xchg_acquire β€” atomic exchange with acquire ordering πŸ¦‹


✨ SYNOPSIS ✨

s64 atomic64_xchg_acquire (atomic64_t *v , s64 new );

like, that's it. that's the whole vibe check πŸ’…


πŸŽ€ ARGUMENTS πŸŽ€

  • v β€” pointer to atomic64_t 🫢 (yes bestie, a pointer, don't hand it the struct itself, i'm begging)
  • new β€” the s64 value to assign ⭐

🧚 DESCRIPTION 🧚

So here's the tea β˜• β€” it atomically updates v to new with acquire ordering. Like, atomically atomically. No one can catch it halfway through, no cap πŸ”₯

⚠️ okay this part matters β€” it's unsafe to use in noinstr code. if you're in there, use raw_atomic64_xchg_acquire instead. like, do not come for this function in noinstr land, it will not go well for you 😭

πŸ‘‘ RETURN πŸ‘‘

the original value of v πŸ’€βœ¨ β€” yes, you get the old one back, that's the whole point of an exchange, bestie, it's giving swap.


🌈 SEE ALSO 🌈

the source file for all of this is the kernel file ./include/linux/atomic/atomic-instrumented.h β€” go say hi 🫢

and now, the extended family. it's a big family. like thanksgiving-dinner big πŸ“

the atomic girlies:

the atomic64 crew (our girl's home team πŸ’–):

the atomic_long cousins 🌟:


okay that's the whole squad, ily, go read them all πŸ§šπŸ’œ


✨ cute little sign-off ✨ β€” this icon of a page comes courtesy of the source ./include/linux/atomic, dated October 2026, and it's your girl atomic64_xchg_acquire(9) signing off. periodt πŸ’…πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from