#include "philo.h"

int	destroy_mutexes(t_rules *rules)
{
	int	i;

	i = 0;
	if (pthread_mutex_destroy(rules->death_lock))
		return(FAILURE);
	if (pthread_mutex_destroy(rules->print_lock))
		return(FAILURE);
	while (i < rules->n_philos)
	{
		if (pthread_mutex_destroy(&rules->forks[i]))
			return(FAILURE);
		i++;
	}
	return (SUCCESS);
}