save from school

This commit is contained in:
Hugo LAMY
2022-01-20 15:45:49 +01:00
parent ac9d619731
commit 9a59f54641
4 changed files with 34 additions and 27 deletions

View File

@@ -9,7 +9,8 @@ t_philo *lst_add_philo(t_philo *philo, t_params *params, t_mtx *m_print, int i)
return (NULL);
new->params = params;
new->philo_nbr = i + 1;
new->fork = 1;
if (pthread_mutex_init(&(new->m_fork), NULL) != 0)
return (NULL);
new->m_print = m_print;
if (philo)
philo->next = new;