This repository has been archived on 2022-08-01. You can view files and clone it, but cannot push or open issues or pull requests.
Threads/queue.h

22 lines
487 B
C
Raw Normal View History

2020-06-24 12:51:34 +00:00
/* file: queue.h -- definitions for queue manipulation routines. */
#ifndef QUEUE_DEFINED
#define QUEUE_DEFINED
typedef struct qitem {
struct qitem *next; /* this must always be first; can cast to any struct with this first */
} Qitem;
typedef struct queue {
Qitem *front, *back;
} Queue;
int queue_init(Queue *q);
int queue_empty(Queue *q);
void queue_put(Queue *q, Qitem *new_item);
Qitem *queue_get(Queue *q);
#endif
/* end file: queue.h */