Added shared struct and made code run

This commit is contained in:
2022-10-12 15:44:12 -05:00
parent 160dc9a99e
commit b5b11c2979
12 changed files with 40 additions and 19 deletions
+1 -1
View File
@@ -2,7 +2,7 @@
#define CONSUMER_H
void Consumer(void);
void consume_item(int item);
void consume_item(long int item);
long int remove_item(void);
#endif
+1 -1
View File
@@ -3,6 +3,6 @@
void Producer(void);
long int produce_item(void);
void insert_item(int item);
void insert_item(long int item);
#endif
+13
View File
@@ -0,0 +1,13 @@
#ifndef SHARED_H
#define SHARED_H
#include <semaphore.h>
typedef struct sharedMem
{
int buffer[10];
sem_t semConsumer;
sem_t semProducer;
} sharedMem;
#endif