meilleur organisation code structures et variables
This commit is contained in:
@@ -10,17 +10,23 @@ typedef struct s_params
|
||||
int t_eat; // time_to_eat
|
||||
int t_slp; // time_to_sleep
|
||||
int n_eat; // [number_of_times_each_philosopher_must_eat]
|
||||
} t_params;
|
||||
|
||||
typedef struct s_global
|
||||
{
|
||||
int dead;
|
||||
long int t_start_s;
|
||||
long int t_start_u;
|
||||
} t_params;
|
||||
t_mtx m_print;
|
||||
t_mtx m_dead;
|
||||
} t_global;
|
||||
|
||||
typedef struct s_philo
|
||||
{
|
||||
t_params *params;
|
||||
t_global *global;
|
||||
int p_nbr;
|
||||
t_mtx m_fork;
|
||||
t_mtx *m_print;
|
||||
long int t_last_meal_s;
|
||||
long int t_last_meal_u;
|
||||
struct s_philo *next;
|
||||
|
||||
Reference in New Issue
Block a user