Changements mineurs
This commit is contained in:
parent
8120c1e351
commit
5c142579ba
@ -1,10 +1,10 @@
|
||||
CC = gcc
|
||||
CONS = consommateur
|
||||
PROD = producteur
|
||||
CFLAGS = -Wall -g
|
||||
CFLAGS = -Wall -g -std=c99
|
||||
COMMUN = sema.o global.o
|
||||
all: $(COMMUN) consommateur.o producteur.o
|
||||
$(CC) consommateur.o -o $(CONS) -std=c99 sema.o
|
||||
$(CC) consommateur.o -o $(CONS) sema.o
|
||||
$(CC) producteur.o -o $(PROD) sema.o
|
||||
|
||||
sema.o : sema.c sema.h
|
||||
|
@ -31,9 +31,10 @@ int main( int argc, char **argv)
|
||||
if((mutex_tpa = creat_sem( sem_key_tpa, 1)) == -1)
|
||||
{ perror("creat_sem"); exit(EXIT_FAILURE); }
|
||||
|
||||
P(mutex_data);
|
||||
|
||||
P(mutex_data);
|
||||
|
||||
V(mutex_data);
|
||||
V(mutex_data);
|
||||
|
||||
/* utilisation */
|
||||
// printf("memoireP[0] = %d\n", memoireP[0]++ );
|
||||
|
@ -10,6 +10,8 @@
|
||||
#include <sys/sem.h>
|
||||
#include "sema.h"
|
||||
|
||||
typedef unsigned short int ushort;
|
||||
|
||||
int creat_sem(key_t cle,int val)
|
||||
{
|
||||
int semid;
|
||||
|
Loading…
Reference in New Issue
Block a user