ww_mutex_unlock(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ ww_mutex_unlock πŸ’…

okay so bestie, we're in the Kernel API Manual today and the star of the show is ww_mutex_unlock β€” yes, the w/w mutex release function, and honestly? she's iconic. let's get into it πŸŽ€


🌸 NAME 🌸

ww_mutex_unlock β€” release the w/w mutex, periodt πŸ’…


✨ SYNOPSIS ✨

void ww_mutex_unlock (struct ww_mutex *lock );

that's it, that's the whole signature, no cap 🫢


πŸ¦‹ ARGUMENTS πŸ¦‹

  • lock β€” the mutex to be released. that's the one you're letting go of, bestie, like releasing a friendship bracelet back into the wild πŸ’–

πŸ”₯ DESCRIPTION πŸ”₯

so here's the tea β˜•: you use this to unlock a mutex that this task already locked before, using any of the ww_mutex_lock* functions β€” with or without an acquire context, both are valid, we love flexibility πŸ’…

but listen to me very carefully, bestie, because this is the important part: it is forbidden to release the locks after releasing the acquire context. like, genuinely forbidden. not "eh, it'll probably be fine" forbidden. do not do this πŸ™ˆ

⚠️ also this function must not be used in interrupt context. and unlocking a mutex that's already unlocked? not allowed. nope. absolutely not. that's giving chaos and we don't want that energy πŸ”₯

πŸ’œ SEE ALSO πŸ’œ

go read those too, iykyk πŸ“šβœ¨


🧚 cute little sign-off 🧚

this page lives in ./kernel/locking, dated October 2026, and it's part of the Kernel API Manual β€” the ww_mutex_unlock(9) page specifically, in case you forgot already πŸ˜­πŸ’–

now go forth and unlock responsibly bestie, ily, don't release locks after the acquire context, mwah πŸŒˆπŸ‘‘πŸ’…

πŸ“¦ where this page comes from