atomic_dec_and_test(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… atomic_dec_and_test(9) πŸ’–

okay so welcome to the Kernel API Manual, bestie β€” today’s main character is atomic_dec_and_test(9), and honestly it’s giving tiny-but-iconic. πŸŽ€


🌸 NAME 🌸

atomic_dec_and_test β€” decrement and test. periodt. ✨

✨ SYNOPSIS ✨

int atomic_dec_and_test (atomic_t *v );

no cap, that’s the whole signature. 🫢

πŸŽ€ ARGUMENTS πŸŽ€

  • v β€” pointer of type atomic_t. literally that’s the argument, bestie. πŸ’–

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so here’s the vibe: it atomically decrements v by 1, then returns true if the result is 0, or false for all other cases. slay. πŸ’…πŸ”₯

like, the way that it checks whether the decrement landed exactly on zero? iconic behavior. πŸ‘‘

🌈 SEE ALSO 🌈


mwah 😘 this cutie is filed under source/version ./tools/include/asm-generic, dated October 2026, and yes β€” the page is atomic_dec_and_test(9). πŸ«ΆπŸ’–

πŸ“¦ where this page comes from