Q_PUSH(3) Librecast Programmer's Manual Q_PUSH(3)

q_push - push a job onto a smolq queue

Librecast library (liblibrecast, -llibrecast)

#include <librecast/q.h>
int  q_push(q_t *q, void *(*f)(void *), void *restrict arg);
int  q_trypush(q_t *q, void *(*f)(void *), void *restrict arg);

Compile and link with -llibrecast.

q_push() pushes f onto the queue q with argument arg.

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

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

( q_trypush()) The operation could not be performed without blocking. (i.e., the queue was full).

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

q_job_seek(3), q_pool_create(3), q_pool_destroy(3), q_init(3), q_free(3), q_wait(3), sem_post(3), sem_wait(3)

2023-07-25 LIBRECAST