q_push3
Push a job onto a smolq queue
Usage
#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.
Library
Librecast library (liblibrecast, -llibrecast)
Overview
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.
Return value
The q_push() function returns zero on success. On error, -1 is returned and errno is set to indicate the error.
Errors
- EAGAIN
-
(
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).