cBroadcast(3)

πŸ’– cBroadcast β€” a util/ulocks.h moment πŸ’–

okay bestie, so we're in section 3 of the manual (the library-call girlies 🫢), and this one lives in util/ulocks.h β€” the ClearSilver util lock crew. her whole thing? she yells at everyone. in a good way. πŸ’…


✨ NAME ✨

cBroadcast β€” broadcast signal to all waiting threads.

like, not one thread. not two. all of them. she's a group-chat announcement, not a DM. πŸ“£


🌸 SYNOPSIS 🌸

#include <util/ulocks.h>

NEOERR *cBroadcast(pthread_cond_t *cond);

yes queen, that's the whole signature. one arg, one NEOERR * coming back at you. ✨


πŸŽ€ ARGUMENTS πŸŽ€

  • cond β€” condition variable to broadcast on. that's the pthread_cond_t you're screaming into. it's giving "the group chat". πŸ’¬

πŸ¦‹ DESCRIPTION πŸ¦‹

Broadcasts a signal to all threads waiting on condition variable cond.

so picture it: a bunch of threads are sitting there in cWait(3), parked, napping, not doing a single thing. cBroadcast walks in and goes "EVERYONE UP" and every single one of them gets the signal. not a lottery, not a raffle, everybody. πŸ‘‘

MT-Level: Safe.

(translation: she's thread-safe, she's well-behaved, she knows what she's doing, no cap. 🧚)


πŸ’€ RETURN VALUE πŸ’€

None.

literally nothing comes back. she returns, that's it. no NEOERR drama to check, no "did it work" moment. it just works. periodt. πŸ’…


🌈 SEE ALSO 🌈

the whole friend group, go say hi:


lowkey if you're deciding between cSignal(3) and cBroadcast β€” one wakes a thread, the other wakes all of them. choose accordingly, bestie, don't play yourself. πŸ™ˆ

okay that's the page!! πŸ’– this one came from ClearSilver, dated 12 July 2007 β€” an absolute icon, she's been slaying since '07 and we're obsessed. mwah πŸŽ€βœ¨πŸ’œ