This commit is contained in:
Camille Chauvet
2023-04-25 11:30:55 +00:00
2 changed files with 3 additions and 1 deletions

2
data.c
View File

@ -11,6 +11,7 @@
bool data_init(t_data *data)
{
data->stop = 0;
data->forks = malloc(sizeof(bool) * data->nb_philos);
if (data->forks == NULL)
return (1);
@ -31,7 +32,6 @@ bool data_init(t_data *data)
pthread_mutex_init(&data->forks_mutex, NULL);
pthread_mutex_init(&data->stop_mutex, NULL);
pthread_mutex_init(&data->print_mutex, NULL);
data->stop = 0;
return (0);
}