From ef2eb4e9214edca43a78ca42b312134e830c578b Mon Sep 17 00:00:00 2001 From: hugogogo Date: Mon, 31 Jan 2022 19:32:17 +0100 Subject: [PATCH] eleve g3 dans makefile --- philo/Makefile | 2 +- philo/srcs/exec.c | 29 ++--------------------------- 2 files changed, 3 insertions(+), 28 deletions(-) diff --git a/philo/Makefile b/philo/Makefile index 4c907ca..9914864 100644 --- a/philo/Makefile +++ b/philo/Makefile @@ -2,7 +2,7 @@ NAME = philo CC = clang -CFLAGS = -Wall -Wextra -Werror $(INCLUDES) -g3 # del g3 +CFLAGS = -Wall -Wextra -Werror $(INCLUDES) VPATH = $(DIR_SRCS) DIR_SRCS = srcs diff --git a/philo/srcs/exec.c b/philo/srcs/exec.c index 792644c..8ac94e2 100644 --- a/philo/srcs/exec.c +++ b/philo/srcs/exec.c @@ -6,7 +6,7 @@ /* By: hulamy +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2022/01/31 10:23:55 by hulamy #+# #+# */ -/* Updated: 2022/01/31 18:07:43 by hulamy ### ########.fr */ +/* Updated: 2022/01/31 19:31:54 by hulamy ### ########.fr */ /* */ /* ************************************************************************** */ @@ -34,25 +34,6 @@ static int ret_err_unlock(t_mtx *fork1, t_mtx *fork2) return (1); } -/* -Thread #3: lock order "0x54542E8 before 0x54541F8" violated - -Observed (incorrect) order is: acquisition of lock at 0x54541F8 - at 0x4C3603C: ??? (in /usr/lib/valgrind/vgpreload_helgrind-amd64-linux.so) - by 0x4011BC: eat (exec.c:27) - by 0x401119: philo_exec (exec.c:72) - by 0x4C38C26: ??? (in /usr/lib/valgrind/vgpreload_helgrind-amd64-linux.so) - by 0x4E4B6DA: start_thread (pthread_create.c:463) - by 0x518471E: clone (clone.S:95) - - followed by a later acquisition of lock at 0x54542E8 - at 0x4C3603C: ??? (in /usr/lib/valgrind/vgpreload_helgrind-amd64-linux.so) - by 0x401226: eat (exec.c:32) - by 0x401119: philo_exec (exec.c:72) - by 0x4C38C26: ??? (in /usr/lib/valgrind/vgpreload_helgrind-amd64-linux.so) - by 0x4E4B6DA: start_thread (pthread_create.c:463) - by 0x518471E: clone (clone.S:95) -*/ static int eat(t_philo *philo, t_mtx *fork1, t_mtx *fork2) { pthread_mutex_lock(fork1); @@ -76,15 +57,9 @@ static int eat(t_philo *philo, t_mtx *fork1, t_mtx *fork2) } /* -// offset launch : +** offset launch : if (philo->p_nbr % 2 == 0) usleep(10 * 1000); -// righty / lefty : - if (philo->p_nbr % 2 == 0) - { - fork1 = &(philo->next->m_fork); - fork2 = &(philo->m_fork); - } */ void *philo_exec(void *arg) {