Commented the data structures in queue.h.
- Commented all the data structures in queue, to make it slightly clearer as to their usage and what they store.
This commit is contained in:
parent
feb1743425
commit
66e0279e78
|
@ -12,6 +12,7 @@
|
|||
// Let the compiler know there will be structs defined elsewhere:
|
||||
typedef struct queue queue;
|
||||
|
||||
// An enum which is used to state what type of data is being stored in a queueNode:
|
||||
typedef enum queueDataType
|
||||
{
|
||||
EVENT,
|
||||
|
@ -20,6 +21,7 @@ typedef enum queueDataType
|
|||
OUTPUT_MESSAGE
|
||||
} queueDataType;
|
||||
|
||||
// A union for storing a pointer to all the types of data a queueNode may hold:
|
||||
typedef union queueData
|
||||
{
|
||||
outputMessage * outputMessage;
|
||||
|
@ -27,6 +29,7 @@ typedef union queueData
|
|||
commandEvent * command;
|
||||
} queueData;
|
||||
|
||||
// A queue node, a singly-linked list node for our queue:
|
||||
typedef struct queueNode queueNode;
|
||||
typedef struct queueNode
|
||||
{
|
||||
|
@ -35,6 +38,7 @@ typedef struct queueNode
|
|||
queueNode * next;
|
||||
} queueNode;
|
||||
|
||||
// A queue, with pointers to the head and tail of the linked list, and data for multi-threading, locking, and an item count.
|
||||
typedef struct queue
|
||||
{
|
||||
volatile bool lock;
|
||||
|
|
Loading…
Reference in New Issue