?fix: initialise all value
This commit is contained in:
parent
26e9f21238
commit
f51039c735
2
philo.c
2
philo.c
@ -146,7 +146,9 @@ t_philo *philo_init(t_data *data)
|
|||||||
philo->id = id++;
|
philo->id = id++;
|
||||||
philo->data = data;
|
philo->data = data;
|
||||||
philo->nb_meal = 0;
|
philo->nb_meal = 0;
|
||||||
|
philo->stop = 0;
|
||||||
philo->last_eat = get_time();
|
philo->last_eat = get_time();
|
||||||
|
philo->last_sleep = get_time();
|
||||||
pthread_mutex_init(&philo->nb_meal_mutex, NULL);
|
pthread_mutex_init(&philo->nb_meal_mutex, NULL);
|
||||||
pthread_mutex_init(&philo->last_eat_mutex, NULL);
|
pthread_mutex_init(&philo->last_eat_mutex, NULL);
|
||||||
pthread_mutex_init(&philo->last_sleep_mutex, NULL);
|
pthread_mutex_init(&philo->last_sleep_mutex, NULL);
|
||||||
|
Loading…
Reference in New Issue
Block a user