fix: check if all threads is stopped before destroye data

This commit is contained in:
Camille Chauvet
2023-04-19 14:01:59 +00:00
parent 07a72c7f89
commit c674f68b2e
3 changed files with 37 additions and 10 deletions

View File

@ -28,6 +28,8 @@ typedef struct s_philo
size_t last_eat;
pthread_mutex_t last_sleep_mutex;
size_t last_sleep;
pthread_mutex_t stop_mutex;
bool stop;
t_data *data;
} t_philo;