logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

q_wait - return the next job from the queue, when available

Description

q_wait() atomically fetches the next job in q and sets the job pointer to it. The call blocks until a job
       is available.

       q_trywait()  is  the  same as q_wait() except that if the queue read lock cannot be immediately obtained,
       then the call returns an error (errno set to EAGAIN) instead of blocking.

Errors

       The function can also fail with the errors for sem_post(3) or sem_wait(3).

Library

       Librecast library (liblibrecast, -llibrecast)

Name

       q_wait - return the next job from the queue, when available

Return Value

       The q_push() function returns zero on success. On error, -1 is returned and errno is set to indicate  the
       error.

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)

LIBRECAST                                          2023-07-25                                          Q_WAIT(3)

Synopsis

#include<librecast/q.h>intq_wait(q_t*q,q_job_t*job);intq_trywait(q_t*q,q_job_t*job);

       Compile and link with -llibrecast.

See Also