source: lib/data-struct/message_queue.h @ 8af0d01

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

Remove inlines for BSD support

  • Property mode set to 100644
File size: 838 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_message_queue_t {
9        int pipefd[2];
10        volatile int message_count;
11        size_t message_len;
12        pthread_spinlock_t spin;
13} libtrace_message_queue_t;
14
15void libtrace_message_queue_init(libtrace_message_queue_t *mq, size_t message_len);
16int libtrace_message_queue_put(libtrace_message_queue_t *mq, const void *message);
17int libtrace_message_queue_count(const libtrace_message_queue_t *mq);
18int libtrace_message_queue_get(libtrace_message_queue_t *mq, void *message);
19int libtrace_message_queue_try_get(libtrace_message_queue_t *mq, void *message);
20void libtrace_message_queue_destroy(libtrace_message_queue_t *mq);
21int libtrace_message_queue_get_fd(libtrace_message_queue_t *mq);
22
23#endif
Note: See TracBrowser for help on using the repository browser.