4.0.1-hotfixescachetimestampsdevelopdpdk-ndagetsilivelibtrace4ndag_formatpfringrc-4.0.1rc-4.0.2rc-4.0.3rc-4.0.4ringdecrementfixringperformanceringtimestampfixes
Last change
on this file since 29bbef0 was
29bbef0,
checked in by Richard Sanger <rsangerarj@…>, 8 years ago
|
My work from over summer, with a few things tidied up and updated to include recent commits/patches to bring this up to date. Still very much work in progress.
|
-
Property mode set to
100644
|
File size:
832 bytes
|
Line | |
---|
1 | #include <pthread.h> |
---|
2 | |
---|
3 | #ifndef DEQUE_H |
---|
4 | #define DEQUE_H |
---|
5 | |
---|
6 | typedef struct list_node list_node_t; |
---|
7 | typedef struct libtrace_queue { |
---|
8 | list_node_t * head; |
---|
9 | list_node_t * tail; |
---|
10 | pthread_mutex_t lock; |
---|
11 | int size; |
---|
12 | int element_size; |
---|
13 | } libtrace_queue_t; |
---|
14 | |
---|
15 | void libtrace_deque_init(libtrace_queue_t * q, int element_size); |
---|
16 | inline void libtrace_deque_push_back(libtrace_queue_t *q, void *d); |
---|
17 | inline void libtrace_deque_push_front(libtrace_queue_t *q, void *d); |
---|
18 | inline int libtrace_deque_get_size(libtrace_queue_t *q); |
---|
19 | |
---|
20 | inline int libtrace_deque_peek_front(libtrace_queue_t *q, void *d); |
---|
21 | inline int libtrace_deque_peek_tail(libtrace_queue_t *q, void *d); |
---|
22 | inline int libtrace_deque_pop_front(libtrace_queue_t *q, void *d); |
---|
23 | inline int libtrace_deque_pop_tail(libtrace_queue_t *q, void *d); |
---|
24 | inline void libtrace_zero_deque(libtrace_queue_t *q); |
---|
25 | |
---|
26 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.