-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathphilo.h
More file actions
executable file
·51 lines (44 loc) · 1.61 KB
/
philo.h
File metadata and controls
executable file
·51 lines (44 loc) · 1.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* philo.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: kdrissi- <kdrissi-@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/10/03 20:00:16 by kdrissi- #+# #+# */
<<<<<<< HEAD
/* Updated: 2021/10/10 00:09:53 by kdrissi- ### ########.fr */
=======
/* Updated: 2021/10/06 22:49:40 by kdrissi- ### ########.fr */
>>>>>>> 10e6f321463b0ef428fe88b13f55d6591c2bc4ad
/* */
/* ************************************************************************** */
#ifndef PHILO_H
#define PHILO_H
#include <unistd.h>
#include <stdio.h>
#include <pthread.h>
#include <stdlib.h>
#include <time.h>
typedef unsigned long t_time;
typedef struct s_philo
{
pthread_t *id;
pthread_t supervisor;
pthread_mutex_t *fork;
pthread_mutex_t print;
t_time *last_time_eated;
t_time start;
t_time time_to_eat;
t_time time_to_sleep;
t_time time_to_die;
int *check1;
int check2;
int must_eat_count;
int kayna;
int *is_eating;
int nbr;
int index;
} t_philo;
void *life_of_a_philo(t_philo *philo);
#endif