29#ifndef __KOS_WORKER_THREAD_H
30#define __KOS_WORKER_THREAD_H
46typedef struct kthread_job {
72 void (*routine)(
void *),
void *data);
Thread creation attributes.
Definition thread.h:284
Structure describing one job for the worker.
Definition worker_thread.h:46
void * data
User pointer to the work data.
Definition worker_thread.h:51
STAILQ_ENTRY(kthread_job) entry
List handle.
Structure describing one running thread.
Definition thread.h:169
Opaque structure describing one worker thread.
void thd_worker_wakeup(kthread_worker_t *thd)
Wake up a worker thread.
kthread_t * thd_worker_get_thread(kthread_worker_t *thd)
Get a handle to the underlying thread.
void thd_worker_destroy(kthread_worker_t *thd)
Stop and destroy a worker thread.
void thd_worker_add_job(kthread_worker_t *thd, kthread_job_t *job)
Add a new job to the worker thread.
static kthread_worker_t * thd_worker_create(void(*routine)(void *), void *data)
Create a new worker thread.
Definition worker_thread.h:89
kthread_worker_t * thd_worker_create_ex(const kthread_attr_t *attr, void(*routine)(void *), void *data)
Create a new worker thread with the specific set of attributes.
kthread_job_t * thd_worker_dequeue_job(kthread_worker_t *worker)
Dequeue one job from the worker thread's to-do queue.
kthread_worker_t * thd_worker_create_ex(const kthread_attr_t *attr, void(*routine)(void *), void *data)
Create a new worker thread with the specific set of attributes.