/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* philo.h :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: dkaiser # include # include # include # include # include "ft_utils.h" # define ERR_USAGE "Usage: [times_must_eat]" # define ERR_MALLOC "Memory allocation failed" typedef struct s_fork { int available; pthread_mutex_t mutex; } t_fork; typedef struct s_phdata { int nbr_of_philos; int time_to_die; int time_to_eat; int time_to_sleep; int times_must_eat; int simulation_running; t_fork *forks; } t_phdata; typedef struct s_philo { int id; int times_eaten; int is_alive; pthread_t thread; t_phdata *data; } t_philo; #endif