Q_WAIT(3)
π Q_WAIT(3) β the Librecast Programmer's Manual glow-up π
okay bestie, sit down, hydrate, because we're about to talk about q_wait from the Librecast Programmer's Manual and honestly? she's iconic. this is the page for pulling the next job off your queue and she does it with main character energy. no cap.
β¨ NAME β¨
q_wait β return the next job from the queue, when available π
πΈ LIBRARY πΈ
Librecast library (liblibrecast, -llibrecast) π¦
π SYNOPSIS π
#include <librecast/q.h>
int q_wait(q_t *q, q_job_t *job);
int q_trywait(q_t *q, q_job_t *job);
and like, you gotta compile and link with -llibrecast. don't forget it, that's the vibe check. β¨
π«Ά DESCRIPTION π«Ά
so q_wait() atomically fetches the next job in q and sets the job pointer to it. the call blocks until a job is available. literally she will just stand there, patiently, waiting for a job to show up, because she's loyal like that. π
q_trywait() is the same as q_wait() β same energy, same job-fetching β except that if the queue read lock cannot be immediately obtained, then the call returns an error (errno set to EAGAIN) instead of blocking. she's not gonna wait around. she's like "lock's busy? okay byee π" and hands you an error instead.
so real talk:q_wait()= patient queen,q_trywait()= girl who does not wait. pick based on whether you want to block or not. π
π RETURN VALUE π
The q_push() function returns zero on success. On error, -1 is returned and errno is set to indicate the error.
ngl the page literally says q_push() here β that's what it says, i'm not making it up, i'm just the messenger bestie π i'm reporting it exactly as written, character for character. π
π ERRORS π
The function can also fail with the errors for sem_post(3) or sem_wait(3). so if something goes sideways, those are the places to look, fr fr.
π SEE ALSO π
q_job_seek(3)q_pool_create(3)q_pool_destroy(3)q_init(3)q_free(3)q_push(3)sem_post(3)sem_wait(3)
and that's the whole page, bestie!! πβ¨ππ¦πΈ
this lil masterpiece is from LIBRECAST, dated 2023-07-25, and it's page Q_WAIT(3) β like, that's the source, the version and the date, all wrapped up in a bow ππ«Ά go forth and wait on your queues, queen. periodt. π π
π¦ where this page comes from
- debian trixie: liblibrecast-dev 0.9.1-1 Β· GPL-2.0-only OR GPL-3.0-only
- nixos 26.05: librecast 0.11.2
- nixpkgs unstable: librecast 0.11.2
- ubuntu noble: liblibrecast-dev 0.8.0-1.1build1 Β· GPL-2.0-only OR GPL-3.0-only
- ubuntu questing: liblibrecast-dev 0.9.1-1
- ubuntu resolute: liblibrecast-dev 0.11.2-2 Β· GPL-2.0-only OR GPL-3.0-only
- ubuntu stonking: liblibrecast-dev 0.11.2-2build1 Β· GPL-2.0-only OR GPL-3.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms