producers-consumers/include/shared.h

18 lines
282 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];
sem_t mutex;
sem_t empty;
sem_t full;
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