.TH Q_JOB_SEEK 3 2023-07-23 "LIBRECAST" "Librecast Programmer's Manual" .SH NAME q_job_seek \- wait for and execute jobs from a smolq queue .SH LIBRARY Librecast library .RI ( liblibrecast ", " \-llibrecast ) .SH SYNOPSIS .nf .B #include .PP .BI "void *q_job_seek(void " *arg ");" .fi .PP Compile and link with \fI\-llibrecast\fP. .SH DESCRIPTION The .BR q_job_seek () function atomically fetches the next .IR job in .IR q and executes it before looping and repeating. This is intended to be used as the start_routine for .BR pthread_create (3) or used as the function .IR f when calling .BR q_pool_create (3). .PP The function loops indefinitely until the thread is cancelled with .BR pthread_cancel (3) or .BR q_pool_destroy (3). .PP .SH RETURN VALUE The .BR q_job_seek () function returns the same pointer .IR arg that was passed to it. .PP .SH ERRORS None. .PP .SH SEE ALSO .BR q_pool_create (3), .BR q_pool_destroy (3), .BR q_init (3), .BR q_free (3), .BR q_push (3), .BR q_wait (3), .BR sem_wait (3), .BR pthread_cancel (3), .BR pthread_create (3)