diff options
Diffstat (limited to 'philo_one/src/philo_one.h')
| -rw-r--r-- | philo_one/src/philo_one.h | 50 |
1 files changed, 14 insertions, 36 deletions
diff --git a/philo_one/src/philo_one.h b/philo_one/src/philo_one.h index e92fdcd..2c04316 100644 --- a/philo_one/src/philo_one.h +++ b/philo_one/src/philo_one.h @@ -6,7 +6,7 @@ /* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2019/11/24 06:11:16 by cacharle #+# #+# */ -/* Updated: 2020/09/29 14:15:47 by cacharle ### ########.fr */ +/* Updated: 2020/09/30 07:48:36 by cacharle ### ########.fr */ /* */ /* ************************************************************************** */ @@ -21,24 +21,22 @@ # include <limits.h> # include <stdarg.h> -typedef long int t_time; +# include "common.h" -typedef enum -{ - EVENT_FORK, - EVENT_EAT, - EVENT_SLEEP, - EVENT_THINK, - EVENT_DIE -} t_philo_event; +// typedef long int t_time; + +// typedef enum +// { +// EVENT_FORK, +// EVENT_EAT, +// EVENT_SLEEP, +// EVENT_THINK, +// EVENT_DIE +// } t_philo_event; typedef struct { - int philo_num; - t_time timeout_death; - t_time timeout_eat; - t_time timeout_sleep; - int meal_num; + t_philo_args args; bool all_alive; pthread_mutex_t mutex_stdout; pthread_mutex_t mutex_all_alive; @@ -82,7 +80,7 @@ bool philos_start( t_philo *philos, t_routine_arg *routine_args, int num); -void philos_join(t_philo *philos, int num); +void philos_detach(t_philo *philos, int num); /* ** routine.c @@ -100,24 +98,4 @@ void io_think(t_routine_arg *arg); void io_sleep(t_routine_arg *arg); void io_die(t_routine_arg *arg); -/* -** common.c -*/ - -bool parse_args( - t_philo_conf *philo_args, - int argc, - char **argv); - -/* -** helper.c -*/ - -long int h_atou_strict(char *s); -void h_putnbr(unsigned long num); -void h_putchar(char c); -void h_putstr(char *s); -int h_err(int ret, const char *format, ...); -t_time h_time_now(void); - #endif |
