atomic_dec_and_wake_up(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ atomic_dec_and_wake_up(9) ✨

okay so bestie, welcome to the atomic_dec_and_wake_up page from the Kernel API Manual β€” this one's a little kernel function that does a thing and then, like, politely tells everyone waiting that they can go now πŸ’…


πŸŽ€ NAME πŸŽ€

atomic_dec_and_wake_up β€” decrement an atomic_t, and if it hits zero, wake up the waiters 🫢


🌸 SYNOPSIS 🌸

bool atomic_dec_and_wake_up (atomic_t *var );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • var β€” the variable to dec and test ✨ (yes, both, it's a whole multitasking icon)

πŸ’– DESCRIPTION πŸ’–

So here's the vibe: it decrements the atomic variable, and if that decrement brings it all the way down to zero, it sends a wake_up to any processes that are waiting on that variable 😭 like "bestie the count is done, you may proceed."

Highkey important: this function has the same complete ordering semantics as atomic_dec_and_test. Not "kind of similar", not "close enough" β€” the same complete ordering semantics. No cap. πŸ”₯

Returns true if the variable reaches zero and the wake up was sent πŸ‘‘


πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file ./include/linux/wait_bit.h β€” and honestly the whole wait_bit extended universe, all of it, every single one, no skipping πŸ™ˆ:


fr fr go read the wait_bit.h crew next, they're all iconic ⭐

mwah, that's the page πŸ’œ this lil number lives in ./include/linux and the version stamp on it is October 2026 β€” dated, slayed, and permanently serving πŸŒˆπŸ’…

πŸ“¦ where this page comes from