summaryrefslogtreecommitdiff
path: root/src/utils.c
blob: e409f7d93cbc2c87057f67170e01d5d161813cb0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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);
}