diff --git a/G17_bykes/main.c b/G17_bykes/main.c index 896635604c211d9802468ca06319f615885fa372..b8bea9edf915a61d52b0b1df598119d34cecf182 100644 --- a/G17_bykes/main.c +++ b/G17_bykes/main.c @@ -13,7 +13,7 @@ #define DEPOT 0 -#define USLEEP 0 +#define USLEEP 1 sem_t *sem_FreeSlot; sem_t *sem_BikeFree; @@ -40,7 +40,7 @@ struct Truck{ int nbCivilians; }; -struct cities{ +struct city{ int nb_bikesParked; int nb_P_waiting; }; @@ -50,7 +50,7 @@ int rand_D(); //void civilians_PassiveMode(void *arg); void *trucks(void *arg); void *civilians(void *arg); -struct cities *cities; //this table is the size of the number of cities, each cities has NParkinglot and each numbers represents a free parkinglot +struct city *cities; //this table is the size of the number of cities, each cities has NParkinglot and each numbers represents a free parkinglot int main(int argc, char **argv){ @@ -68,7 +68,7 @@ int main(int argc, char **argv){ pthread_t *threadCivilians = malloc(sizeof(pthread_t)*nbCivilians); pthread_t *threadTruck = malloc(sizeof(pthread_t)); - cities = calloc(nbcities, sizeof(struct cities)); + cities = calloc(nbcities, sizeof(struct city)); struct civilian *Civilians = calloc(nbCivilians, sizeof(struct civilian)); struct Truck *truck = malloc(sizeof(struct Truck));