33 lines
1.1 KiB
C
33 lines
1.1 KiB
C
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* main.c :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: hulamy <marvin@42.fr> +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2022/01/26 15:30:40 by hulamy #+# #+# */
|
|
/* Updated: 2022/01/26 15:32:30 by hulamy ### ########.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
#include "philo.h"
|
|
|
|
int main(int ac, char **av)
|
|
{
|
|
pthread_t *id;
|
|
t_philo *philo;
|
|
int i;
|
|
|
|
philo = init(ac, av, &id);
|
|
if (philo == NULL)
|
|
return (0);
|
|
launch_threads(philo, id);
|
|
i = 0;
|
|
while (i < philo->params->n_phi)
|
|
{
|
|
pthread_join(id[i], NULL);
|
|
i++;
|
|
}
|
|
return (0);
|
|
}
|