1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/** A FIFO queue */
typedef struct queue queue_t;
typedef struct queue_node queue_node_t;
/**
* Creates a new heap-allocated FIFO queue. The queue is initially empty.
*
* @return a pointer to the new queue
*/
queue_t *;
/**
* Enqueues a value into a queue. There is no maximum capacity,
* so this should succeed unless the program runs out of memory.
* This function should be concurrency-safe:
* multiple threads may call queue_enqueue() or queue_dequeue() simultaneously.
*
* @param queue the queue to append to
* @param value the value to add to the back of the queue
*/
void ;
/**
* Dequeues a value from a queue.
* The value returned is the first enqueued value that was not yet dequeued.
* If the queue is empty, this thread should block until another thread enqueues a value.
* This function should be concurrency-safe:
* multiple threads may call queue_enqueue() or queue_dequeue() simultaneously.
*
* @param queue the queue to remove from
* @return the value at the front of the queue
*/
void *;
/**
* Frees all resources associated with a heap-allocated queue.
* You may assume that the queue is already empty.
*
* @param queue a queue returned from queue_init()
*/
void ;
/* QUEUE_H */