42 lines
1.3 KiB
C
42 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/12 16:56:46 by erey-bet ### ########.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
#ifndef PHILO_H
|
|
# define PHILO_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;
|
|
int id;
|
|
} t_philo;
|
|
|
|
# include "../utils/utils.h"
|
|
# include <stdlib.h>
|
|
# include <unistd.h>
|
|
# include <pthread.h>
|
|
# include<sys/wait.h>
|
|
|
|
int parsing(char *argv[], t_config *conf);
|
|
int manage_threads(t_config *conf);
|
|
void *philosopher(t_philo *philo);
|
|
|
|
#endif
|