atomic_dec_and_test(9)
π 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 typeatomic_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 π
- Kernel file
./tools/include/asm-generic/atomic-gcc.hβ plus the bestie refsatomic_read(9),atomic_set(9), andatomic_inc(9). π¦π
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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms