28 lines
1.2 KiB
C
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:33: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("%07zu %03zu %s\n", time, philo->id + 1, "died");
|
|
pthread_mutex_unlock(&data->print_mutex);
|
|
}
|