Container for worker tasks.
#include "global.h"
#include <pthread.h>
Go to the source code of this file.
◆ threadqueue_job_t
typedef struct threadqueue_job_t threadqueue_job_t |
◆ threadqueue_queue_t
typedef struct threadqueue_queue_t threadqueue_queue_t |
◆ kvz_threadqueue_copy_ref()
Increment reference count and return the job.
◆ kvz_threadqueue_free()
- Returns
- 1 on success, 0 on failure
◆ kvz_threadqueue_free_job()
Decrement reference count of the job. If no references exist any more, deallocate associated memory and destroy mutexes.
Sets the job pointer to NULL.
◆ kvz_threadqueue_init()
- Returns
- 1 on success, 0 on failure
◆ kvz_threadqueue_job_create()
threadqueue_job_t * kvz_threadqueue_job_create |
( |
void(* | fptr )(void *arg), |
|
|
void * | arg ) |
The job is created in a paused state. Function kvz_threadqueue_submit must be called on the job in order to have it run.
- Returns
- pointer to the job, or NULL on failure
◆ kvz_threadqueue_job_dep_add()
- Parameters
-
job | job that should be executed after dependency |
dependency | job that should be executed before job |
- Returns
- 1 on success, 0 on failure
◆ kvz_threadqueue_stop()
Block until all threads have stopped.
- Returns
- 1 on success, 0 on failure
◆ kvz_threadqueue_submit()
◆ kvz_threadqueue_waitfor()
- Returns
- 1 on success, 0 on failure