fix: add 0 to the print
This commit is contained in:
parent
aefb6ceec0
commit
008b30e12c
@ -6,7 +6,7 @@
|
|||||||
/* By: cchauvet <cchauvet@student.42angouleme.fr +#+ +:+ +#+ */
|
/* By: cchauvet <cchauvet@student.42angouleme.fr +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2023/04/27 11:33:33 by cchauvet #+# #+# */
|
/* Created: 2023/04/27 11:33:33 by cchauvet #+# #+# */
|
||||||
/* Updated: 2023/05/17 13:22:19 by cchauvet ### ########.fr */
|
/* Updated: 2023/05/17 13:33:17 by cchauvet ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
@ -30,7 +30,7 @@ static void print(t_data *data, size_t id, char *str)
|
|||||||
if (stop == false)
|
if (stop == false)
|
||||||
{
|
{
|
||||||
time = get_time();
|
time = get_time();
|
||||||
printf("%zu %zu %s\n", time, id, str);
|
printf("%07zu %07zu %s\n", time, id + 1, str);
|
||||||
}
|
}
|
||||||
pthread_mutex_unlock(&data->print_mutex);
|
pthread_mutex_unlock(&data->print_mutex);
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
/* By: cchauvet <cchauvet@student.42angouleme.fr +#+ +:+ +#+ */
|
/* By: cchauvet <cchauvet@student.42angouleme.fr +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2023/04/27 11:41:14 by cchauvet #+# #+# */
|
/* Created: 2023/04/27 11:41:14 by cchauvet #+# #+# */
|
||||||
/* Updated: 2023/05/17 13:21:33 by cchauvet ### ########.fr */
|
/* Updated: 2023/05/17 13:33:33 by cchauvet ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
@ -22,6 +22,6 @@ void print_died(t_philo *philo)
|
|||||||
data = philo->data;
|
data = philo->data;
|
||||||
time = get_time();
|
time = get_time();
|
||||||
pthread_mutex_lock(&data->print_mutex);
|
pthread_mutex_lock(&data->print_mutex);
|
||||||
printf("%7zu %3zu %s\n", time, philo->id, "died");
|
printf("%07zu %03zu %s\n", time, philo->id + 1, "died");
|
||||||
pthread_mutex_unlock(&data->print_mutex);
|
pthread_mutex_unlock(&data->print_mutex);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user