diff --git a/philo/src/philo.c b/philo/src/philo.c index 984cb2e..14e34f0 100644 --- a/philo/src/philo.c +++ b/philo/src/philo.c @@ -6,7 +6,7 @@ /* By: houtworm // \ \ __| | | \ \/ / */ /* (| | )|_| |_| |> < */ /* Created: 2023/03/11 06:42:31 by houtworm /'\_ _/`\__|\__,_/_/\_\ */ -/* Updated: 2023/05/24 01:08:23 by djonker \___)=(___/ */ +/* Updated: 2023/05/24 02:43:39 by djonker \___)=(___/ */ /* */ /* ************************************************************************** */ @@ -81,10 +81,10 @@ int ft_liveordie(t_strct *stct, int i) if (ft_time() - stct->philo[i].lastfood > stct->dietime) { pthread_mutex_unlock(&stct->drlastfood); - printf("%lld %d died\n", ft_time() - stct->strtt, stct->philo[i].id); pthread_mutex_lock(&stct->drdead); stct->dead = 1; pthread_mutex_unlock(&stct->drdead); + printf("%lld %d died\n", ft_time() - stct->strtt, stct->philo[i].id); return (1); } else diff --git a/philo/src/util.c b/philo/src/util.c index 8044af3..72e8347 100644 --- a/philo/src/util.c +++ b/philo/src/util.c @@ -6,7 +6,7 @@ /* By: houtworm // \ \ __| | | \ \/ / */ /* (| | )|_| |_| |> < */ /* Created: 2023/03/15 02:01:41 by houtworm /'\_ _/`\__|\__,_/_/\_\ */ -/* Updated: 2023/05/24 01:09:41 by djonker \___)=(___/ */ +/* Updated: 2023/05/24 02:48:50 by djonker \___)=(___/ */ /* */ /* ************************************************************************** */ @@ -88,7 +88,6 @@ void ft_aliveprint(t_philo *ps, char *str) pthread_mutex_unlock(ps->drdead); return ; } - pthread_mutex_unlock(ps->drdead); printf("%lld %d %s\n", ft_time() - *ps->strtt, ps->id, str); + pthread_mutex_unlock(ps->drdead); } -// write?