Changements mineurs

master
Philippe Pittoli 2011-03-20 10:45:36 +01:00
parent 8120c1e351
commit 5c142579ba
3 changed files with 7 additions and 4 deletions

View File

@ -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

View File

@ -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]++ );

View File

@ -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;