diff options
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); +} |
