Initial commit

This commit is contained in:
2024-12-08 19:04:50 +02:00
commit 4853b9ef0a
11 changed files with 295 additions and 0 deletions

22
include/consumer.h Normal file
View File

@@ -0,0 +1,22 @@
//
// Created by lumijiez on 11/16/24.
//
#ifndef CONSUMER_H
#define CONSUMER_H
#include "buffer.h"
#include <semaphore>
class Consumer {
public:
Consumer(int id, Buffer& buffer, std::counting_semaphore<5>& sem);
void run() const;
private:
int id;
Buffer& buffer;
std::counting_semaphore<5>& consumerSem;
};
#endif //CONSUMER_H