?fix: initialise all value

This commit is contained in:
starnakin 2023-04-20 18:27:12 +02:00
parent 26e9f21238
commit f51039c735

View File

@ -146,7 +146,9 @@ t_philo *philo_init(t_data *data)
philo->id = id++; philo->id = id++;
philo->data = data; philo->data = data;
philo->nb_meal = 0; philo->nb_meal = 0;
philo->stop = 0;
philo->last_eat = get_time(); philo->last_eat = get_time();
philo->last_sleep = get_time();
pthread_mutex_init(&philo->nb_meal_mutex, NULL); pthread_mutex_init(&philo->nb_meal_mutex, NULL);
pthread_mutex_init(&philo->last_eat_mutex, NULL); pthread_mutex_init(&philo->last_eat_mutex, NULL);
pthread_mutex_init(&philo->last_sleep_mutex, NULL); pthread_mutex_init(&philo->last_sleep_mutex, NULL);