bozosujet

This commit is contained in:
Camille Chauvet
2023-05-17 13:28:42 +02:00
parent 8371b01390
commit aefb6ceec0
21 changed files with 0 additions and 0 deletions

36
philo/data.h Normal file
View File

@ -0,0 +1,36 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* data.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: cchauvet <cchauvet@student.42angouleme.fr +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/04/27 11:33:06 by cchauvet #+# #+# */
/* Updated: 2023/04/27 11:33:06 by cchauvet ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef DATA_H
# define DATA_H
# include <pthread.h>
# include <sys/types.h>
typedef struct s_data
{
size_t eat_time;
size_t sleep_time;
size_t life_expectency;
size_t nb_philos;
size_t nb_meals;
void **philos;
pthread_t *threads;
pthread_mutex_t *forks;
pthread_mutex_t stop_mutex;
bool stop;
pthread_mutex_t print_mutex;
} t_data;
bool data_init(t_data *data);
void data_destroyer(t_data *data);
size_t get_min_meal(t_data *data);
#endif