Split program into three files, added arguments for fork amounts, and passes sharedID into forks for exec
This commit is contained in:
@@ -1,8 +1,4 @@
|
||||
#ifndef CONSUMER_H
|
||||
#define CONSUMER_H
|
||||
|
||||
void* Consumer(void* arg);
|
||||
void consume_item(long int item);
|
||||
long int remove_item(void);
|
||||
|
||||
#endif
|
||||
@@ -1,8 +1,5 @@
|
||||
#ifndef PRODUCER_H
|
||||
#define PRODUCER_H
|
||||
|
||||
void* Producer(void* arg);
|
||||
long int produce_item(void);
|
||||
void insert_item(long int item);
|
||||
|
||||
#endif
|
||||
@@ -2,6 +2,8 @@
|
||||
#define SHARED_H
|
||||
#include <semaphore.h>
|
||||
|
||||
int StringToNumber(char* argv);
|
||||
|
||||
typedef struct SharedStruct
|
||||
{
|
||||
int buffer[10];
|
||||
|
||||
Reference in New Issue
Block a user