TUT HEVC Encoder
|
Container for worker tasks. More...
Go to the source code of this file.
Typedefs | |
typedef struct threadqueue_job_t | threadqueue_job_t |
typedef struct threadqueue_queue_t | threadqueue_queue_t |
Functions | |
threadqueue_queue_t * | kvz_threadqueue_init (int thread_count) |
Initialize the queue. | |
threadqueue_job_t * | kvz_threadqueue_job_create (void(*fptr)(void *arg), void *arg) |
Create a job and return a pointer to it. | |
int | kvz_threadqueue_submit (threadqueue_queue_t *threadqueue, threadqueue_job_t *job) |
int | kvz_threadqueue_job_dep_add (threadqueue_job_t *job, threadqueue_job_t *dependency) |
Add a dependency between two jobs. | |
threadqueue_job_t * | kvz_threadqueue_copy_ref (threadqueue_job_t *job) |
Get a new pointer to a job. | |
void | kvz_threadqueue_free_job (threadqueue_job_t **job_ptr) |
Free a job. | |
int | kvz_threadqueue_waitfor (threadqueue_queue_t *threadqueue, threadqueue_job_t *job) |
Wait for a job to be completed. | |
int | kvz_threadqueue_stop (threadqueue_queue_t *threadqueue) |
Stop all threads after they finish the current jobs. | |
void | kvz_threadqueue_free (threadqueue_queue_t *threadqueue) |
Stop all threads and free allocated resources. | |
threadqueue_job_t * kvz_threadqueue_copy_ref | ( | threadqueue_job_t * | job | ) |
Increment reference count and return the job.
void kvz_threadqueue_free | ( | threadqueue_queue_t * | threadqueue | ) |
void kvz_threadqueue_free_job | ( | threadqueue_job_t ** | job_ptr | ) |
Decrement reference count of the job. If no references exist any more, deallocate associated memory and destroy mutexes.
Sets the job pointer to NULL.
threadqueue_queue_t * kvz_threadqueue_init | ( | int | thread_count | ) |
threadqueue_job_t * kvz_threadqueue_job_create | ( | void(*)(void *arg) | fptr, |
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.
int kvz_threadqueue_job_dep_add | ( | threadqueue_job_t * | job, |
threadqueue_job_t * | dependency | ||
) |
job | job that should be executed after dependency |
dependency | job that should be executed before job |
int kvz_threadqueue_stop | ( | threadqueue_queue_t *const | threadqueue | ) |
Block until all threads have stopped.
int kvz_threadqueue_submit | ( | threadqueue_queue_t * | threadqueue, |
threadqueue_job_t * | job | ||
) |
int kvz_threadqueue_waitfor | ( | threadqueue_queue_t * | threadqueue, |
threadqueue_job_t * | job | ||
) |