diff --git a/main.c b/main.c index dd35aa2..f915f7f 100644 --- a/main.c +++ b/main.c @@ -19,7 +19,9 @@ size_t get_min_meal(t_data *data) t_philo *philo; philo = data->philos[0]; + pthread_mutex_lock(&philo->nb_meal_mutex); min = philo->nb_meal; + pthread_mutex_unlock(&philo->nb_meal_mutex); i = 1; while (i < data->nb_philos) {