philosopher/philo/philo.h
Etienne Rey-bethbeder e88ec90f41 Add
2023-03-13 18:34:33 +01:00

43 lines
1.3 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* philo.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: erey-bet <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/03/08 14:51:16 by erey-bet #+# #+# */
/* Updated: 2023/03/13 14:01:59 by erey-bet ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef PHILO_H
# define PHILO_H
# include "../utils/utils.h"
# include <stdlib.h>
# include <unistd.h>
# include <pthread.h>
# include <sys/wait.h>
typedef struct s_config
{
int nbr_philo;
int time_die;
int time_eat;
int time_sleep;
int must_eat;
} t_config;
typedef struct s_philo
{
t_config conf;
pthread_mutex_t mutex;
int *id;
} t_philo;
int parsing(char *argv[], t_config *conf);
int manage_threads(t_config *conf);
void *philosopher(t_philo *philo);
#endif