Q_JOB_SEEK(3)

✨ q_job_seek(3) ✨

okay bestie, welcome to the Librecast Programmer's Manual, section 3, and today's main character is q_job_seek πŸ’…


πŸŽ€ NAME πŸŽ€

q_job_seek β€” wait for and execute jobs from a smolq queue πŸ¦‹


πŸ“š LIBRARY πŸ“š

Librecast library (liblibrecast, -llibrecast) πŸ’–


πŸͺ„ SYNOPSIS πŸͺ„

#include <librecast/q.h>

void *q_job_seek(void *arg);

Compile and link with -llibrecast.


🌸 DESCRIPTION 🌸

so the q_job_seek() function does one thing and it does it iconically: it atomically fetches the next job in q and executes it, then loops around and does it all over again. like a lil worker bee that never gets tired 🐝✨

This is meant to be used as the start_routine for pthread_create(3), or as the function f when you're calling q_pool_create(3). that's literally its whole purpose, iykyk 🫢

The function loops indefinitely until the thread gets cancelled with pthread_cancel(3) or with q_pool_destroy(3). no cap, it will just keep going forever until somebody stops it πŸ’€


🫧 RETURN VALUE 🫧

q_job_seek() returns the same pointer arg that was passed to it. that's it. that's the return value. give it back exactly what you got, king πŸ‘‘


πŸ™ˆ ERRORS πŸ™ˆ

None. not a single one. she simply does not error πŸ’œ


πŸ‘€ SEE ALSO πŸ‘€


and that's the whole page bestie, slay πŸ’…βœ¨

this lil masterpiece came from LIBRECAST and it's dated 2023-07-23 β€” go read the other pages, ily, bye πŸŽ€πŸ¦‹πŸ’–

πŸ“¦ where this page comes from