From 47beba686ff9d2aab63738fba7176a5235703d05 Mon Sep 17 00:00:00 2001 From: yctct Date: Sun, 13 Sep 2026 18:58:14 +0200 Subject: Add all files, first commit --- src/utils.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/utils.c (limited to 'src/utils.c') diff --git a/src/utils.c b/src/utils.c new file mode 100644 index 0000000..e409f7d --- /dev/null +++ b/src/utils.c @@ -0,0 +1,20 @@ +#include "codexion.h" + +void swap(t_ticket a, t_ticket b) +{ + t_ticket temp; + + temp = a; + a = b; + b = temp; +} + +int get_id(t_philo *philo) +{ + int id; + + (void)pthread_mutex_lock(&philo->mutex_id); + id = philo->id; + (void)pthread_mutex_unlock(&philo->mutex_id); + return (id); +} -- cgit v1.2.3