Kohi Game Engine
worker_thread.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "containers/queue.h"
4 #include "threads/kmutex.h"
5 #include "threads/ksemaphore.h"
6 #include "threads/kthread.h"
7 #include "defines.h"
8 
9 typedef struct worker_thread {
14 
16 
18 
19 KAPI b8 worker_thread_add(worker_thread* thread, pfn_thread_start work_fn, void* params);
20 
22 
This file contains global type definitions which are used throughout the entire engine and applicatio...
#define KAPI
Import/export qualifier.
Definition: defines.h:205
_Bool b8
8-bit boolean type
Definition: defines.h:58
u32(* pfn_thread_start)(void *)
Definition: kthread.h:18
A simple queue container. Elements are popped off the queue in the same order they were pushed to it.
Definition: kmutex.h:10
Definition: kthread.h:11
A simple queue container. Elements are popped off the queue in the same order they were pushed to it.
Definition: queue.h:21
Definition: worker_thread.h:9
kmutex queue_mutex
Definition: worker_thread.h:12
kthread thread
Definition: worker_thread.h:10
queue work_queue
Definition: worker_thread.h:11
KAPI b8 worker_thread_start(worker_thread *thread)
KAPI void worker_thread_destroy(worker_thread *thread)
KAPI b8 worker_thread_add(worker_thread *thread, pfn_thread_start work_fn, void *params)
KAPI b8 worker_thread_wait(worker_thread *thread)
KAPI b8 worker_thread_create(worker_thread *out_thread)
struct worker_thread worker_thread