make ringbuffer thread safety optional

This commit is contained in:
2025-05-25 15:27:00 +02:00
parent 52e2c96e0e
commit 11146fb632
3 changed files with 22 additions and 2 deletions

View File

@ -6,7 +6,9 @@ struct ringBuffer {
size_t blockSize;
void *reader;
void *writer;
#ifdef RINGBUFFER_THREAD_SAFE
pthread_mutex_t mutex;
#endif
};
void ringBufferCreate(int blocks, size_t blockSize, struct ringBuffer *out);