source: lib/data-struct/message_queue.h @ 82facc5

4.0.1-hotfixescachetimestampsdevelopdpdk-ndagetsilivelibtrace4ndag_formatpfringrc-4.0.1rc-4.0.2rc-4.0.3rc-4.0.4ringdecrementfixringperformanceringtimestampfixes
Last change on this file since 82facc5 was 82facc5, checked in by Richard Sanger <rsangerarj@…>, 8 years ago

Adds a thread keepalive that sends a messages to the perpkt threads every second(still todo make this configurable)
Updated tracertstats to use this rather than the temporary result system which has been removed
Also fixes a handful of compile warnings

  • Property mode set to 100644
File size: 939 bytes
Line 
1#include <pthread.h>
2#include <limits.h>
3
4#ifndef LIBTRACE_MESSAGE_QUEUE
5#define LIBTRACE_MESSAGE_QUEUE
6
7#define LIBTRACE_MQ_FAILED INT_MIN
8typedef struct libtrace_thread_t libtrace_thread_t;
9typedef struct libtrace_message_queue_t {
10        int pipefd[2];
11        volatile int message_count;
12        size_t message_len;
13        pthread_spinlock_t spin;
14} libtrace_message_queue_t;
15
16inline void libtrace_message_queue_init(libtrace_message_queue_t *mq, size_t message_len);
17inline int libtrace_message_queue_put(libtrace_message_queue_t *mq, const void *message);
18inline int libtrace_message_queue_count(const libtrace_message_queue_t *mq);
19inline int libtrace_message_queue_get(libtrace_message_queue_t *mq, void *message);
20inline int libtrace_message_queue_try_get(libtrace_message_queue_t *mq, void *message);
21inline void libtrace_message_queue_destroy(libtrace_message_queue_t *mq);
22inline int libtrace_message_queue_get_fd(libtrace_message_queue_t *mq);
23
24#endif
Note: See TracBrowser for help on using the repository browser.