aboutsummaryrefslogtreecommitdiff
path: root/include/kpl/queue.h
diff options
context:
space:
mode:
authornodist <kevin.comas.git@gmail.com>2026-09-24 14:36:15 -0400
committernodist <kevin.comas.git@gmail.com>2026-09-24 14:36:15 -0400
commit9a82127c476bf99556bbc69e181025afcba19d26 (patch)
tree62b9d7023a83506ae4069ac0feb11784a2f6114e /include/kpl/queue.h
parentfc9f60972bc30634180b1da32d680768c51844d2 (diff)
ring buffer tests
Diffstat (limited to 'include/kpl/queue.h')
-rw-r--r--include/kpl/queue.h7
1 files changed, 6 insertions, 1 deletions
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);