aboutsummaryrefslogtreecommitdiff
path: root/philo_one/src/philo.c
diff options
context:
space:
mode:
authorCharles Cabergs <me@cacharle.xyz>2021-01-08 17:57:23 +0100
committerCharles Cabergs <me@cacharle.xyz>2021-01-08 17:57:23 +0100
commit36c5e3a81de8b910bc04a37994b53296c1540353 (patch)
treeed8ff37d914606ba3b4d6921956bd9b29cac0f17 /philo_one/src/philo.c
parentad7ed73c124c8fcda6629350307f0f4f41b87fe3 (diff)
downloadphilosophers-36c5e3a81de8b910bc04a37994b53296c1540353.tar.gz
philosophers-36c5e3a81de8b910bc04a37994b53296c1540353.tar.bz2
philosophers-36c5e3a81de8b910bc04a37994b53296c1540353.zip
Added separate thread to flush buffer in philo_one and philo_two
Diffstat (limited to 'philo_one/src/philo.c')
-rw-r--r--philo_one/src/philo.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/philo_one/src/philo.c b/philo_one/src/philo.c
index f86dfb6..589e1c7 100644
--- a/philo_one/src/philo.c
+++ b/philo_one/src/philo.c
@@ -6,7 +6,7 @@
/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/02/09 23:47:14 by cacharle #+# #+# */
-/* Updated: 2021/01/04 10:42:53 by cacharle ### ########.fr */
+/* Updated: 2021/01/08 16:15:10 by charles ### ########.fr */
/* */
/* ************************************************************************** */
@@ -54,7 +54,11 @@ bool philos_start(t_philo *philos, long int num)
}
i = -1;
while (++i < num)
+ {
pthread_mutex_unlock(&philos[i].mutex_start);
+ /* usleep(1000); */
+ }
+
return (true);
}