diff options
| author | nodist <kevin.comas.git@gmail.com> | 2026-09-24 14:36:15 -0400 |
|---|---|---|
| committer | nodist <kevin.comas.git@gmail.com> | 2026-09-24 14:36:15 -0400 |
| commit | 9a82127c476bf99556bbc69e181025afcba19d26 (patch) | |
| tree | 62b9d7023a83506ae4069ac0feb11784a2f6114e /include/kpl | |
| parent | fc9f60972bc30634180b1da32d680768c51844d2 (diff) | |
ring buffer tests
Diffstat (limited to 'include/kpl')
| -rw-r--r-- | include/kpl/process.h | 2 | ||||
| -rw-r--r-- | include/kpl/queue.h | 7 |
2 files changed, 8 insertions, 1 deletions
diff --git a/include/kpl/process.h b/include/kpl/process.h index b47e122..7d13daf 100644 --- a/include/kpl/process.h +++ b/include/kpl/process.h @@ -35,6 +35,8 @@ typedef struct _kpl_task { } kpl_task; typedef struct { + int32_t thread_id; + kpl_env *env; kpl_task_queue task_queue; _Atomic ssize_t priority; // TODO diff --git a/include/kpl/queue.h b/include/kpl/queue.h index 3d77e13..977a32d 100644 --- a/include/kpl/queue.h +++ b/include/kpl/queue.h @@ -20,6 +20,11 @@ void kpl_task_queue_add(kpl_task_queue *task_queue, kpl_task *task); kpl_task *kpl_task_queue_next(kpl_task_queue *task_queue); +typedef enum : int8_t { + KPL_RING_QUEUE_MIN_POW2 = 4, + KPL_RING_QUEUE_MAX_POW2 = 30 +} kpl_ring_queue_pow2_sizes; + typedef struct { _Atomic ssize_t index; void *data; @@ -31,7 +36,7 @@ typedef struct { kpl_ring_queue_item *items; } kpl_ring_queue; -void kpl_ring_queue_init(kpl_ring_queue *ring_queue, int8_t size_pow); +bool kpl_ring_queue_init(kpl_ring_queue *ring_queue, int8_t size_pow2); void kpl_ring_queue_free(kpl_ring_queue *ring_queue); |
