Initial commit
This commit is contained in:
22
include/producer.h
Normal file
22
include/producer.h
Normal file
@@ -0,0 +1,22 @@
|
||||
//
|
||||
// Created by lumijiez on 11/16/24.
|
||||
//
|
||||
|
||||
#ifndef PRODUCER_H
|
||||
#define PRODUCER_H
|
||||
|
||||
#include "buffer.h"
|
||||
#include <semaphore>
|
||||
|
||||
class Producer {
|
||||
public:
|
||||
Producer(int id, Buffer& buffer, std::counting_semaphore<3>& sem);
|
||||
void run() const;
|
||||
|
||||
private:
|
||||
int id;
|
||||
Buffer& buffer;
|
||||
std::counting_semaphore<3>& producerSem;
|
||||
};
|
||||
|
||||
#endif //PRODUCER_H
|
||||
Reference in New Issue
Block a user