From eb2cfb574efafcf2c3c6200d1cd2de700ec8ddfb Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Sun, 10 Jan 2021 10:54:04 +0100 Subject: Fixing bad performance at school by adding more delay to the death checking loop, Added mutex/semaphore to protect against eating and dying at the same time --- philo_three/src/philo_three.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'philo_three/src/philo_three.h') diff --git a/philo_three/src/philo_three.h b/philo_three/src/philo_three.h index 18c7bcb..f11b8c7 100644 --- a/philo_three/src/philo_three.h +++ b/philo_three/src/philo_three.h @@ -6,7 +6,7 @@ /* By: cacharle +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/02/15 00:46:26 by cacharle #+# #+# */ -/* Updated: 2021/01/09 15:47:32 by charles ### ########.fr */ +/* Updated: 2021/01/10 10:26:27 by cacharle ### ########.fr */ /* */ /* ************************************************************************** */ @@ -58,6 +58,7 @@ typedef struct s_philo sem_t *sem_meal_num; sem_t *sem_start; sem_t *sem_grab; + sem_t *sem_eat; } t_philo; pid_t child_start(t_philo *arg); -- cgit