From 6a1e91750ee43fccb6160af0f44139698c8dfdc3 Mon Sep 17 00:00:00 2001 From: Charles Date: Sat, 15 Feb 2020 00:36:04 +0100 Subject: philo_two working (again with the hack?) --- philo_two/philo_two.h | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 philo_two/philo_two.h (limited to 'philo_two/philo_two.h') diff --git a/philo_two/philo_two.h b/philo_two/philo_two.h new file mode 100644 index 0000000..d239e34 --- /dev/null +++ b/philo_two/philo_two.h @@ -0,0 +1,45 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* philo_two.h :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cacharle +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2020/02/14 22:47:23 by cacharle #+# #+# */ +/* Updated: 2020/02/14 23:55:04 by cacharle ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#ifndef PHILO_TWO_H +# define PHILO_TWO_H + +# include +# include +# include "common.h" + +typedef struct +{ + int id; + t_philo_args *args; + t_time time_last_eat; + sem_t *forks; +} t_routine_arg; + +/* +** routine.c +*/ + +void *routine_philo(void *void_arg); +void *routine_death(void *void_arg); +t_routine_arg *routine_args_create(t_philo_args *philo_args, sem_t *forks); + +/* +** io.c +*/ + +void io_eat(t_routine_arg *arg); +void io_think(t_routine_arg *arg); +void io_sleep(t_routine_arg *arg); +void io_die(t_routine_arg *arg); + +#endif -- cgit