correction loop chained list
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#ifndef PHILO_PROTO_H
|
||||
# define PHILO_PROTO_H
|
||||
|
||||
pthread_mutex_t mutex;
|
||||
// t_mtx mutex;
|
||||
|
||||
// init.c
|
||||
t_philo *init(int ac, char **av, pthread_t **id);
|
||||
|
||||
@@ -1,20 +1,23 @@
|
||||
#ifndef PHILO_STRUCT_H
|
||||
# define PHILO_STRUCT_H
|
||||
|
||||
typedef struct s_conditions
|
||||
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]
|
||||
} t_conditions;
|
||||
} t_params;
|
||||
|
||||
typedef struct s_philo
|
||||
{
|
||||
t_conditions *conditions;
|
||||
t_params *params;
|
||||
int philo_nbr;
|
||||
int fork;
|
||||
t_mtx *msg_mtx;
|
||||
struct s_philo *prev;
|
||||
struct s_philo *next;
|
||||
} t_philo;
|
||||
|
||||
Reference in New Issue
Block a user