blob: 5c4f9c460683b5f35029b96399dbabe098506f66 [file] [log] [blame]
Sharvil Nanavatic11b4072014-05-02 23:55:09 -07001#pragma once
2
3#include "list.h"
4
5struct fixed_queue_t;
6typedef struct fixed_queue_t fixed_queue_t;
7
8typedef void (*fixed_queue_free_cb)(void *data);
9
10fixed_queue_t *fixed_queue_new(size_t capacity);
11
12// Freeing a queue that is currently in use (i.e. has waiters
13// blocked on it) resuls in undefined behaviour.
14void fixed_queue_free(fixed_queue_t *queue, fixed_queue_free_cb free_cb);
15
16void fixed_queue_enqueue(fixed_queue_t *queue, void *data);
17void *fixed_queue_dequeue(fixed_queue_t *queue);