fix print mutex is now destroyed at the end
This commit is contained in:
2
data.c
2
data.c
@ -30,6 +30,7 @@ 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);
|
||||
}
|
||||
@ -53,6 +54,7 @@ void data_destroyer(t_data *data)
|
||||
}
|
||||
pthread_mutex_destroy(&data->forks_mutex);
|
||||
pthread_mutex_destroy(&data->stop_mutex);
|
||||
pthread_mutex_destroy(&data->print_mutex);
|
||||
free(data->threads);
|
||||
free(data->forks);
|
||||
philos_destroyer(data);
|
||||
|
||||
Reference in New Issue
Block a user