42_Philosopher/philo/print2.c

28 lines
1.2 KiB
C
Raw Normal View History

2023-04-27 08:05:14 -04:00
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* print2.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: cchauvet <cchauvet@student.42angouleme.fr +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/04/27 11:41:14 by cchauvet #+# #+# */
2023-05-17 07:25:34 -04:00
/* Updated: 2023/05/17 13:21:33 by cchauvet ### ########.fr */
2023-04-27 08:05:14 -04:00
/* */
/* ************************************************************************** */
#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);
2023-05-17 07:25:34 -04:00
printf("%7zu %3zu %s\n", time, philo->id, "died");
2023-04-27 08:05:14 -04:00
pthread_mutex_unlock(&data->print_mutex);
}