Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/dyn_ring_queue.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
#include "dyn_gossip.h"
#include "dyn_token.h"

_C2G_InQ C2G_InQ = {};
_C2G_OutQ C2G_OutQ = {};

// should use pooling to store struct ring_message so that we can reuse
struct ring_msg *create_ring_msg(void) {
struct ring_msg *msg = dn_alloc(sizeof(*msg));
Expand Down
11 changes: 7 additions & 4 deletions src/dyn_ring_queue.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,20 @@ struct gossip_node;
typedef rstatus_t (*callback_t)(void *msg);
typedef void (*data_func_t)(void *);

volatile struct {
typedef volatile struct {
long m_getIdx;
long m_putIdx;
void *m_entry[C2G_InQ_SIZE];
} C2G_InQ;
} _C2G_InQ;

volatile struct {
typedef volatile struct {
long m_getIdx;
long m_putIdx;
void *m_entry[C2G_OutQ_SIZE];
} C2G_OutQ;
} _C2G_OutQ;

extern _C2G_InQ C2G_InQ;
extern _C2G_OutQ C2G_OutQ;

struct ring_msg {
callback_t cb;
Expand Down