From e874ad94a31a8259b8eb7ad2865767c081bcd279 Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Sun, 3 Jan 2021 14:04:22 +0100 Subject: Fixing philo_one/philo_two dying by sleeping more when checking the death, Fixing timestamp in the wrong order in philo_three --- philo_two/src/main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'philo_two/src/main.c') diff --git a/philo_two/src/main.c b/philo_two/src/main.c index e3994e2..0f823b5 100644 --- a/philo_two/src/main.c +++ b/philo_two/src/main.c @@ -6,7 +6,7 @@ /* By: cacharle +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/02/14 22:45:23 by cacharle #+# #+# */ -/* Updated: 2021/01/02 12:49:06 by cacharle ### ########.fr */ +/* Updated: 2021/01/03 13:54:45 by cacharle ### ########.fr */ /* */ /* ************************************************************************** */ @@ -52,6 +52,7 @@ static int st_setup( if ((*philos = routine_create_philos(conf, *forks)) == NULL || (*threads = malloc(sizeof(pthread_t) * conf->philo_num)) == NULL) return (st_destroy(*philos, *threads)); + conf->initial_time = h_time_now(); i = -1; while (++i < conf->philo_num) { -- cgit