raw_atomic_cmpxchg_acquire(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸŽ€ NAME πŸŽ€

raw_atomic_cmpxchg_acquire(9) from the Kernel API Manual β€” bestie, it’s the atomic compare-and-exchange situation, but with acquire ordering. It’s giving β€œonly swap if the value matches” energy. πŸ’…βœ¨

πŸ’– SYNOPSIS πŸ’–

int raw_atomic_cmpxchg_acquire (atomic_t *v , int old , int new );

🫢 ARGUMENTS 🫢

  • v β€” pointer to atomic_t. This is the main character you’re comparing and maybe updating.
  • old β€” the int value to compare with. The β€œare you the one?” of it all.
  • new β€” the int value to assign. The glow-up waiting in the wings.

🌸 DESCRIPTION 🌸

Okay so picture this: if (v == old), it atomically updates v to new with acquire ordering. Slay. Otherwise, v is not modified and relaxed ordering is provided. No cap, that’s the whole vibe.

Safe to use in noinstr code; prefer atomic_cmpxchg_acquire elsewhere. Noted, bestie. 🫑

πŸ”₯ RETURN πŸ”₯

The original value of v. Periodt. That’s what you get back. πŸ’–

πŸ¦‹ SEE ALSO πŸ¦‹


That’s the whole page, bestie: source/version ./include/linux/atomic, dated October 2026, manual page raw_atomic_cmpxchg_acquire(9). Mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from