diff options
| author | Charles Cabergs <me@cacharle.xyz> | 2021-01-01 14:46:13 +0100 |
|---|---|---|
| committer | Charles Cabergs <me@cacharle.xyz> | 2021-01-01 14:46:13 +0100 |
| commit | b9d93edf40f228fcc6e18e9e6d0a1c5db498c004 (patch) | |
| tree | 5abb172c43b54adcf4caef33ede04f64c957246f /philo_two/src/philo_two.h | |
| parent | 83df2b3a49bd3f627ae304bb1529e27d9b2d988c (diff) | |
| download | philosophers-b9d93edf40f228fcc6e18e9e6d0a1c5db498c004.tar.gz philosophers-b9d93edf40f228fcc6e18e9e6d0a1c5db498c004.tar.bz2 philosophers-b9d93edf40f228fcc6e18e9e6d0a1c5db498c004.zip | |
Added meal counter to philo_two (still segfault 10% of the time)
Diffstat (limited to 'philo_two/src/philo_two.h')
| -rw-r--r-- | philo_two/src/philo_two.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/philo_two/src/philo_two.h b/philo_two/src/philo_two.h index b947684..ec5783b 100644 --- a/philo_two/src/philo_two.h +++ b/philo_two/src/philo_two.h @@ -6,13 +6,14 @@ /* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/02/14 22:47:23 by cacharle #+# #+# */ -/* Updated: 2020/10/24 13:03:58 by charles ### ########.fr */ +/* Updated: 2021/01/01 14:18:57 by charles ### ########.fr */ /* */ /* ************************************************************************** */ #ifndef PHILO_TWO_H # define PHILO_TWO_H +# define _XOPEN_SOURCE 500 # include <unistd.h> # include <fcntl.h> # include <stdbool.h> @@ -29,7 +30,9 @@ typedef struct t_time timeout_sleep; long int meal_num; bool all_alive; + long int meal_num_finished_counter; sem_t *sem_stdout; + sem_t *sem_meal_num_finished_counter; } t_philo_conf; typedef struct @@ -44,6 +47,7 @@ typedef struct ** routine.c */ +bool philo_finished(t_philo_conf *conf); void *routine_philo(t_philo *arg); void *routine_death(t_philo *arg); t_philo *routine_create_philos(t_philo_conf *conf, sem_t *forks); |
