NNG_CV_WAKE(3supp)

πŸ“¦ version 1.11, in alpine 3.24

πŸ’… NAME πŸ’…

nng_cv_wake β€” the "EVERYONE WAKE UP, WE'RE DOING THIS" function that wakes all the waiters 🫢

(this one lives in the NNG Reference Manual, section 3supp, bestie β€” that's where all the supplemental goodies hang out ✨)


✨ SYNOPSIS ✨

#include <nng/nng.h>

void nng_cv_wake(nng_cv *cv);

πŸŽ€ DESCRIPTION πŸŽ€

Okay so here's the tea β˜•: nng_cv_wake() wakes up any threads that are waiting on the condition variable cv β€” the ones parked in nng_cv_wait() or nng_cv_until(), just vibing, waiting to be signaled. This function is the signal. It wakes them all. Every single one. No cap. πŸ”₯

House rules though, bestie β€” read this part twice:

The caller must have ownership of the mutex that was used when cv was allocated. Like, this is not optional, this is not a suggestion, this is the whole ass vibe check. πŸ’…

πŸ“ Note: the caller should already have set the condition that the waiters are gonna check β€” and they should have done it while holding the mutex. Don't be out here flipping flags after you've let go of the lock, that's giving chaos energy πŸ™ˆ
πŸ’‘ Tip: this function wakes all the threads, which is generally the safer move β€” safer is slay β€” but ngl it can be a performance problem when there are a ton of waiters 😭 because they all wake up at the exact same moment and then start beefing over resources. Contention. Not cute. If that's your situation, see nng_cv_wake1() β€” that's literally the solution to this exact problem. Go look at it πŸ‘‘

πŸ¦‹ RETURN VALUES πŸ¦‹

None. Nothing. Zero. It returns void and it returns it flawlessly πŸ’œ


🌸 ERRORS 🌸

None. Not a single one. It simply cannot fail to serve πŸ’β€β™€οΈ


🌈 SEE ALSO 🌈


okay that's the whole page bestie, go forth and wake responsibly πŸ§šπŸ’– this one's from the NNG Reference Manual, nng_cv_wake(3supp), dated 2026-01-13 β€” iconic, timeless, exactly as the source wanted it β­πŸ‘‘

πŸ“¦ where this page comes from