static rstatus_t gossip_process_msgs(void) { //TODOs: fix this to process an array of nodes while (!CBUF_IsEmpty(C2G_InQ)) { struct ring_msg *msg = (struct ring_msg *) CBUF_Pop(C2G_InQ); msg->cb(msg); ring_msg_deinit(msg); } return DN_OK; }
static rstatus_t core_process_messages(void) { //loga("Leng of C2G_OutQ ::: %d", CBUF_Len( C2G_OutQ )); while (!CBUF_IsEmpty(C2G_OutQ)) { struct ring_msg *msg = (struct ring_msg *) CBUF_Pop(C2G_OutQ); if (msg != NULL && msg->cb != NULL) { msg->cb(msg); core_debug(msg->sp->ctx); ring_msg_deinit(msg); } } return DN_OK; }