producers-consumers/include/shared.h

17 lines
278 B
C
Raw Normal View History

2022-10-12 15:44:12 -05:00
#ifndef SHARED_H
#define SHARED_H
#include <semaphore.h>
int StringToNumber(char* argv);
2022-10-12 22:59:06 -05:00
typedef struct SharedStruct
2022-10-12 15:44:12 -05:00
{
int buffer[10];
int count[10];
2022-10-12 15:44:12 -05:00
sem_t semConsumer;
sem_t semProducer;
2022-10-12 22:59:06 -05:00
} SharedStruct;
2022-10-12 15:44:12 -05:00
2022-10-15 16:06:55 -05:00
void SharedStructInit(SharedStruct* sharedMem);
2022-10-12 15:44:12 -05:00
#endif