42_Philosopher/philo/print2.c
Camille Chauvet aefb6ceec0 bozosujet
2023-05-17 13:28:42 +02:00

28 lines
1.2 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* print2.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: cchauvet <cchauvet@student.42angouleme.fr +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/04/27 11:41:14 by cchauvet #+# #+# */
/* Updated: 2023/05/17 13:21:33 by cchauvet ### ########.fr */
/* */
/* ************************************************************************** */
#include "philo.h"
#include "./time.h"
#include "./utils/utils.h"
void print_died(t_philo *philo)
{
t_data *data;
size_t time;
data = philo->data;
time = get_time();
pthread_mutex_lock(&data->print_mutex);
printf("%7zu %3zu %s\n", time, philo->id, "died");
pthread_mutex_unlock(&data->print_mutex);
}