Skip to content

Instantly share code, notes, and snippets.

#include <stdlib.h>
#include <stdio.h>
#include <threads.h>
#include <assert.h>
struct ring_buffer {
int* buffer;
size_t size;
size_t write_idx;
size_t readers_count;