From d3d063d793003c374f57a3841f06413676149eb0 Mon Sep 17 00:00:00 2001 From: Houtworm Date: Wed, 24 May 2023 03:08:05 +0200 Subject: [PATCH] done --- philo_bonus/src/watch.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/philo_bonus/src/watch.c b/philo_bonus/src/watch.c index 327f3e6..90e4cda 100644 --- a/philo_bonus/src/watch.c +++ b/philo_bonus/src/watch.c @@ -1,12 +1,12 @@ /* ************************************************************************** */ /* */ /* .--. _ */ -/* watch.c |o_o || | */ +/* watch.c :+: :+: :+: */ /* |:_/ || |_ _ ___ __ */ /* By: djonker // \ \ __| | | \ \/ / */ /* (| | )|_| |_| |> < */ /* Created: 2023/05/24 00:23:22 by djonker /'\_ _/`\__|\__,_/_/\_\ */ -/* Updated: 2023/05/24 02:24:11 by djonker \___)=(___/ */ +/* Updated: 2023/05/24 03:05:35 by houtworm ### ########.fr */ /* */ /* ************************************************************************** */ @@ -65,11 +65,11 @@ void *ft_alive(void *pointer) sem_close(philo->print); hold = sem_open("hold", 0); print = sem_open("print", 0); - sem_wait(philo->hold); + sem_wait(hold); while (ft_time() - philo->lastfood < *philo->dietime) usleep(500); sem_post(philo->dead); - sem_wait(philo->print); + sem_wait(print); if (*philo->alive) printf("%lld %d died\n", ft_time() - *philo->strtt, philo->id); return (NULL);