fix: do not print message exit eating

This commit is contained in:
Camille Chauvet 2023-04-25 15:10:25 +00:00
parent 41bd1149d8
commit 7e7538aa40

View File

@ -19,6 +19,13 @@ bool check(t_philo *philo, t_data *data)
{ {
bool stop; bool stop;
if (get_min_meal(data) == data->nb_meals)
{
pthread_mutex_lock(&philo->stop_mutex);
philo->stop = 1;
pthread_mutex_unlock(&philo->stop_mutex);
return (1);
}
pthread_mutex_lock(&data->stop_mutex); pthread_mutex_lock(&data->stop_mutex);
stop = data->stop; stop = data->stop;
pthread_mutex_unlock(&data->stop_mutex); pthread_mutex_unlock(&data->stop_mutex);