nimp dans timestamp

This commit is contained in:
Hugo LAMY
2022-01-25 18:48:49 +01:00
parent b998de9340
commit d8475537e0
6 changed files with 115 additions and 46 deletions

View File

@@ -3,6 +3,12 @@
typedef pthread_mutex_t t_mtx;
typedef struct s_time
{
long int ts;
long int tu;
} t_time;
typedef struct s_params
{
int n_phi; // number_of_philosophers
@@ -15,8 +21,7 @@ typedef struct s_params
typedef struct s_global
{
int dead;
long int t_start_s;
long int t_start_u;
t_time t_start;
t_mtx m_print;
t_mtx m_dead;
} t_global;
@@ -27,8 +32,8 @@ typedef struct s_philo
t_global *global;
int p_nbr;
t_mtx m_fork;
long int t_last_meal_s;
long int t_last_meal_u;
t_time t_last_meal;
int eat;
struct s_philo *next;
} t_philo;