diff --git a/philo_bonus/src/init.c b/philo_bonus/src/init.c index 4a46e04..ae93a01 100644 --- a/philo_bonus/src/init.c +++ b/philo_bonus/src/init.c @@ -1,12 +1,12 @@ /* ************************************************************************** */ /* */ /* .--. _ */ -/* init.c :+: :+: :+: */ +/* init.c |o_o || | */ /* |:_/ || |_ _ ___ __ */ /* By: houtworm // \ \ __| | | \ \/ / */ /* (| | )|_| |_| |> < */ /* Created: 2023/03/15 02:00:19 by houtworm /'\_ _/`\__|\__,_/_/\_\ */ -/* Updated: 2023/05/22 07:35:35 by houtworm ### ########.fr */ +/* Updated: 2023/05/24 00:23:31 by djonker \___)=(___/ */ /* */ /* ************************************************************************** */ diff --git a/philo_bonus/src/philo.c b/philo_bonus/src/philo.c index 3457ac9..c7718c3 100644 --- a/philo_bonus/src/philo.c +++ b/philo_bonus/src/philo.c @@ -6,7 +6,7 @@ /* By: houtworm // \ \ __| | | \ \/ / */ /* (| | )|_| |_| |> < */ /* Created: 2023/03/11 06:42:31 by houtworm /'\_ _/`\__|\__,_/_/\_\ */ -/* Updated: 2023/05/23 04:03:02 by houtworm \___)=(___/ */ +/* Updated: 2023/05/24 00:29:03 by djonker \___)=(___/ */ /* */ /* ************************************************************************** */ @@ -63,9 +63,9 @@ int ft_startcycle(t_strct *st) i = 0; st->strtt = ft_time(); + st->alive = 1; while (i < st->philos) { - st->alive = 1; st->pid[i] = fork(); if (st->pid[i] == 0) { @@ -102,7 +102,6 @@ int main(int argc, char **argv) } i = ft_initstructandmutex(strct, 0); ft_startcycle(strct); - usleep(1000); strct->pid[501] = fork(); if (strct->pid[501] == 0) ft_waitingfordeath(strct); diff --git a/philo_bonus/src/util.c b/philo_bonus/src/util.c index 700a044..458587b 100644 --- a/philo_bonus/src/util.c +++ b/philo_bonus/src/util.c @@ -1,12 +1,12 @@ /* ************************************************************************** */ /* */ /* .--. _ */ -/* util.c :+: :+: :+: */ +/* util.c |o_o || | */ /* |:_/ || |_ _ ___ __ */ /* By: houtworm // \ \ __| | | \ \/ / */ /* (| | )|_| |_| |> < */ /* Created: 2023/03/15 02:01:41 by houtworm /'\_ _/`\__|\__,_/_/\_\ */ -/* Updated: 2023/05/22 07:36:43 by houtworm ### ########.fr */ +/* Updated: 2023/05/24 00:23:12 by djonker \___)=(___/ */ /* */ /* ************************************************************************** */ diff --git a/philo_bonus/src/watch.c b/philo_bonus/src/watch.c index 528b834..90947ad 100644 --- a/philo_bonus/src/watch.c +++ b/philo_bonus/src/watch.c @@ -1,12 +1,12 @@ /* ************************************************************************** */ /* */ -/* ::: :::::::: */ +/* .--. _ */ /* watch.c |o_o || | */ -/* +:+ +:+ +:+ */ -/* By: houtworm +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2023/05/22 07:34:59 by houtworm #+# #+# */ -/* Updated: 2023/05/23 04:06:37 by houtworm \___)=(___/ */ +/* |:_/ || |_ _ ___ __ */ +/* By: djonker // \ \ __| | | \ \/ / */ +/* (| | )|_| |_| |> < */ +/* Created: 2023/05/24 00:23:22 by djonker /'\_ _/`\__|\__,_/_/\_\ */ +/* Updated: 2023/05/24 00:28:28 by djonker \___)=(___/ */ /* */ /* ************************************************************************** */ @@ -19,7 +19,7 @@ int ft_releasetheminds(t_strct *strct, int m) i = 0; if (m) { - while (i < (strct->philos * 2) - 1) + while (i < (strct->philos * 2)) { sem_post(strct->hold); i++;