source: lib/deque.h @ 29ba7c2

4.0.1-hotfixescachetimestampsdevelopdpdk-ndagetsilivelibtrace4ndag_formatpfringrc-4.0.1rc-4.0.2rc-4.0.3rc-4.0.4ringdecrementfixringperformanceringtimestampfixes
Last change on this file since 29ba7c2 was 29bbef0, checked in by Richard Sanger <rsangerarj@…>, 7 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
6typedef struct list_node list_node_t;
7typedef 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
15void libtrace_deque_init(libtrace_queue_t * q, int element_size);
16inline void libtrace_deque_push_back(libtrace_queue_t *q, void *d);
17inline void libtrace_deque_push_front(libtrace_queue_t *q, void *d);
18inline int libtrace_deque_get_size(libtrace_queue_t *q);
19
20inline int libtrace_deque_peek_front(libtrace_queue_t *q, void *d);
21inline int libtrace_deque_peek_tail(libtrace_queue_t *q, void *d);
22inline int libtrace_deque_pop_front(libtrace_queue_t *q, void *d);
23inline int libtrace_deque_pop_tail(libtrace_queue_t *q, void *d);
24inline void libtrace_zero_deque(libtrace_queue_t *q);
25
26#endif
Note: See TracBrowser for help on using the repository browser.