- Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathqueue.h
More file actions
Latest commit
34 lines (24 loc) · 517 Bytes
/
Copy pathqueue.h
File metadata and controls
34 lines (24 loc) · 517 Bytes
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
#ifndef_QUEUE_H
#define_QUEUE_H
#include<pthread.h>
typedefvoid* (*workCB)(void*arg);
/* Queue node */
typedefstructnode
{
void*data;
structnode*next;
structnode*prev;
}NODE;
typedefstructqueueObj
{
NODE*qHead;
NODE*qTail;
intqCount;
pthread_mutex_tqMutex;
}queueObj_t;
voidqInsert(queueObj_t*qObj, void*data);
voidqRemove(queueObj_t*qObj, void*data, size_tnSize);
voidqDestroy(queueObj_t*qObj);
voidprintQueue(queueObj_t*qObj);
NODE*allocate_node(void*data);
#endif