al_broadcast_cond(3alleg5)

πŸ“¦
version 5.2.11.3 Β· 4 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

✨ NAME ✨

al_broadcast_cond β€” it's giving Allegro 5 API πŸ’– (and yes bestie, this one lives in section 3alleg5 of the manual, we love a lil section number moment)


🫢 SYNOPSIS 🫢

#include <allegro5/allegro.h>

void al_broadcast_cond(ALLEGRO_COND *cond)

🌸 DESCRIPTION 🌸

Okay so listen. You got a condition variable, right? And a whole lil group chat of threads is just sitting there, waiting on it, like "any updates?? πŸ‘€".

al_broadcast_cond unblocks all of them. Every single thread currently waiting on that condition variable β€” freed, released, un-stuck. It's basically you hitting send on the group chat with the news everyone was waiting for. πŸ“£βœ¨

More officially-ish: it broadcasts that some condition those threads were waiting for has become true. Like, the thing they were all refreshing for? It happened. Go, go, go. πŸ¦‹


πŸ‘‘ SEE ALSO πŸ‘‘

Note: The pthreads spec says to lock the mutex associated with cond before signalling, so you get predictable scheduling behaviour. Not me being dramatic, that's literally what the spec says. Lock the mutex first, bestie. πŸ”’πŸ’…

πŸŽ€ THE SIGN-OFF πŸŽ€

And that's the whole page, periodt. This lil gem came to you straight out of the Allegro reference manual, filed under al_broadcast_cond(3alleg5). Go forth and unblock your threads, main character. πŸ’œπŸŒˆβ­

πŸ“¦ where this page comes from