NNG_CV_WAKE(3supp)
π 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 π
nng_cv_alloc(3supp)nng_cv_until(3supp)nng_cv_wait(3supp)nng_cv_wake1(3supp)nng_mtx_alloc(3supp)nng_mtx_lock(3supp)nng_mtx_unlock(3supp)nng(7)
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
- alpine 3.24: nng-doc 1.11-r0 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms