Skip to content

Instantly share code, notes, and snippets.

Bodey Baker porcoesphino

Block or report user

Report or block porcoesphino

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View ProducerConsumerQueue.c
#define LEN 20
void volatile* raw_queue[LEN];
int volatile reader_ctr = 0;
int volatile writer_ctr = 0;
_Bool push_packet(void* pointer) {
ASSERT(pointer != NULL);
bool result = false;
DISABLED_INTERRUPTS(
int nextElement = (writer_ctr + 1) % LEN;
You can’t perform that action at this time.