source: lib/data-struct/message_queue.h @ c63bcdf

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

Add pthread_spinlock so we can build on Apple's

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