|
@ -6,7 +6,7 @@ |
|
|
/* By: narnaud <narnaud@student.42.fr> +#+ +:+ +#+ */ |
|
|
/* By: narnaud <narnaud@student.42.fr> +#+ +:+ +#+ */ |
|
|
/* +#+#+#+#+#+ +#+ */ |
|
|
/* +#+#+#+#+#+ +#+ */ |
|
|
/* Created: 2021/11/24 15:44:04 by narnaud #+# #+# */ |
|
|
/* Created: 2021/11/24 15:44:04 by narnaud #+# #+# */ |
|
|
/* Updated: 2022/05/19 20:07:29 by narnaud@stude ### ########.fr */ |
|
|
/* Updated: 2022/05/19 22:24:51 by narnaud@stude ### ########.fr */ |
|
|
/* */ |
|
|
/* */ |
|
|
/* ************************************************************************** */ |
|
|
/* ************************************************************************** */ |
|
|
|
|
|
|
|
@ -62,10 +62,10 @@ void invit_philos(t_philo *philos) |
|
|
t_philo *philo; |
|
|
t_philo *philo; |
|
|
|
|
|
|
|
|
philo = philos; |
|
|
philo = philos; |
|
|
philo->eat_time = room_clock(); |
|
|
|
|
|
room = philo->room; |
|
|
room = philo->room; |
|
|
while (i >= 0) |
|
|
while (i >= 0) |
|
|
{ |
|
|
{ |
|
|
|
|
|
philo->eat_time = room_clock(); |
|
|
pthread_create(philo->thd, NULL, philos_life, (void *)philo); |
|
|
pthread_create(philo->thd, NULL, philos_life, (void *)philo); |
|
|
pthread_detach(*philo->thd); |
|
|
pthread_detach(*philo->thd); |
|
|
if ((i % 2) == 0) |
|
|
if ((i % 2) == 0) |
|
|