reorganisation structs et timestamp global

This commit is contained in:
Hugo LAMY
2022-01-22 12:41:30 +01:00
parent 6a4aad9503
commit 3ba76ccc4e
5 changed files with 34 additions and 28 deletions

View File

@@ -5,11 +5,14 @@ typedef pthread_mutex_t t_mtx;
typedef struct s_params
{
int n_phi; // number_of_philosophers
int t_die; // time_to_die
int t_eat; // time_to_eat
int t_slp; // time_to_sleep
int n_eat; // [number_of_times_each_philosopher_must_eat]
int n_phi; // number_of_philosophers
int t_die; // time_to_die
int t_eat; // time_to_eat
int t_slp; // time_to_sleep
int n_eat; // [number_of_times_each_philosopher_must_eat]
int dead;
long int t_start_s;
long int t_start_u;
} t_params;
typedef struct s_philo
@@ -18,11 +21,8 @@ typedef struct s_philo
int p_nbr;
t_mtx m_fork;
t_mtx *m_print;
long int t_start_s;
long int t_start_u;
long int t_last_meal_s;
long int t_last_meal_u;
int *death;
struct s_philo *next;
} t_philo;