atomic_long_...turn_acquire(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 atomic_long_add_return_acquire(9) β€” like, the whole vibe πŸ’…

okay bestie, so this page is straight out of the Kernel API Manual and it's about ONE (1) little function that does ONE (1) little thing: add a number to an atomic_long_t and hand you back the shiny new value. with acquire ordering, because we have ✨taste✨. let's get into it 🫢


✨ NAME ✨

atomic_long_add_return_acquire β€” atomic add with acquire ordering. that's it. that's the whole personality. πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

long atomic_long_add_return_acquire (long i , atomic_long_t *v );

πŸ’– ARGUMENTS πŸ’–

  • i β€” the long value you're adding. your contribution. your little gift to the counter 🎁
  • v β€” pointer to the atomic_long_t. this is the main character. point at it with love.

🌈 DESCRIPTION 🌈

so basically: it atomically updates v to (v + i), with acquire ordering. atomic means nobody can catch it mid-update β€” no torn reads, no chaos, it's giving locked-in πŸ”₯. and the acquire ordering is the memory-barrier sauce that makes it safe to lean on this for synchronisation, iykyk.

⚠️ okay this is important, do NOT skip: it's unsafe to use in noinstr code. if you're in noinstr land, use raw_atomic_long_add_return_acquire there instead. that's the rule, periodt. πŸ’€

πŸ‘‘ RETURN πŸ‘‘

the updated value of v. like, the value after the add. fresh. new. iconic. ⭐


🧚 SEE ALSO 🧚

one kernel file gets the credit here: ./include/linux/atomic/atomic-instrumented.h β€” that's the source of truth, no cap.

and now, the family reunion πŸŽ‰ literally everyone showed up:

the plain atomic_* girlies:

the atomic64_* besties (big numbers, big energy):

and the atomic_long_* crew β€” our people, our home base 🏠:

(yes, that's a lot of friends. they all ate. πŸ’…)


that's the whole page, bestie β€” go forth and add atomically πŸ¦‹

mwah πŸ’‹ this one came from ./include/linux/atomic, dated October 2026, and it's filed under atomic_long_...turn_acquire(9) if you ever need to find it again. love u, bye πŸ’œ

πŸ“¦ where this page comes from