aboutsummaryrefslogtreecommitdiff
path: root/philo_one/fork.c
diff options
context:
space:
mode:
authorCharles <sircharlesaze@gmail.com>2020-02-14 01:42:10 +0100
committerCharles <sircharlesaze@gmail.com>2020-02-14 01:42:10 +0100
commitadbe9cdb61e5d12299b8872b2ac27a48036bc95d (patch)
treee8c5028c2f813ae4ee37b741f9b0a0d83af9e6f3 /philo_one/fork.c
parent1a7c6c5a0ed9a5aae1fe45c3af335c120c2dc642 (diff)
downloadphilosophers-adbe9cdb61e5d12299b8872b2ac27a48036bc95d.tar.gz
philosophers-adbe9cdb61e5d12299b8872b2ac27a48036bc95d.tar.bz2
philosophers-adbe9cdb61e5d12299b8872b2ac27a48036bc95d.zip
WIP: philo_one running a bit
Diffstat (limited to 'philo_one/fork.c')
-rw-r--r--philo_one/fork.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/philo_one/fork.c b/philo_one/fork.c
index d42510b..62e3355 100644
--- a/philo_one/fork.c
+++ b/philo_one/fork.c
@@ -6,7 +6,7 @@
/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/02/09 23:46:40 by cacharle #+# #+# */
-/* Updated: 2020/02/10 00:34:17 by cacharle ### ########.fr */
+/* Updated: 2020/02/14 01:29:26 by cacharle ### ########.fr */
/* */
/* ************************************************************************** */
@@ -36,7 +36,7 @@ void forks_destroy(t_fork *forks, int num)
while (num-- > 0)
{
forks[num].used = TRUE;
- pthread_mutex_destroy(&forks[num].mutex);
+ /* pthread_mutex_destroy(&forks[num].mutex); */
}
}
@@ -52,7 +52,7 @@ t_routine_arg *forks_dispatch(t_philo *philos, t_fork *forks, t_philo_args *args
{
routine_args[i].args = args;
routine_args[i].philo = philos + i;
- routine_args[i].fork_left = forks + i % args->philo_num;
+ routine_args[i].fork_right = forks + i % args->philo_num;
routine_args[i].fork_left = forks + (i - 1) % args->philo_num;
}
return (routine_args);