meilleur organisation code structures et variables

This commit is contained in:
Hugo LAMY
2022-01-22 19:16:23 +01:00
parent 3ba76ccc4e
commit cb615cb6b3
7 changed files with 173 additions and 28 deletions

View File

@@ -13,11 +13,22 @@ void launch_threads(t_philo *philo, pthread_t *id)
}
}
int is_dead(t_philo *philo)
{
(void)philo;
return (0);
}
void watch_threads(t_philo *philo, pthread_t *id)
{
int i;
i = 0;
while (1)
{
if (is_dead(philo) == 1)
break ;
}
while (i < philo->params->n_phi)
{
pthread_join(id[i], NULL);