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 --- common/inc/common.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'common/inc') diff --git a/common/inc/common.h b/common/inc/common.h index 6d36e35..56fb284 100644 --- a/common/inc/common.h +++ b/common/inc/common.h @@ -6,7 +6,7 @@ /* By: cacharle +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/02/08 22:58:35 by cacharle #+# #+# */ -/* Updated: 2021/01/04 13:06:52 by charles ### ########.fr */ +/* Updated: 2021/01/10 10:32:17 by cacharle ### ########.fr */ /* */ /* ************************************************************************** */ @@ -56,6 +56,9 @@ bool parse_args(t_philo_args *args, int argc, char **argv); long int h_atou_strict(char *s); t_time h_time_now(void); void h_sleep(t_time sleep_time); +char *h_nbrcpy(char *dst, long long int num); +char *h_strcpy_end(char *dst, const char *str); +const char *philo_sem_eat_name(const char *prefix, long int id); /* ** io.c -- cgit