diff options
| author | yctct <yctct@yctct.com> | 2026-09-13 18:58:14 +0200 |
|---|---|---|
| committer | yctct <yctct@yctct.com> | 2026-09-13 18:58:14 +0200 |
| commit | 47beba686ff9d2aab63738fba7176a5235703d05 (patch) | |
| tree | f839ed36a9e9d4476fcdc59379b17903abfa35c8 /src/utils.c | |
Add all files, first commit
Diffstat (limited to 'src/utils.c')
| -rw-r--r-- | src/utils.c | 20 |
1 files changed, 20 insertions, 0 deletions
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); +} |
