aboutsummaryrefslogtreecommitdiff
path: root/philo/include
diff options
context:
space:
mode:
authorDominik Kaiser2025-01-18 17:04:56 +0100
committerDominik Kaiser2025-01-18 17:04:56 +0100
commit22e40654fadb2373697742e0ff8deb6ad87c6601 (patch)
treea12a7170540653a47824f794909cc269b2a0dc62 /philo/include
parent37ccfe0790fb2100b4bf1d51affef8bca0ae518d (diff)
downloadPhilosophers-22e40654fadb2373697742e0ff8deb6ad87c6601.tar.gz
Philosophers-22e40654fadb2373697742e0ff8deb6ad87c6601.zip
Add handling for times_must_eat
Diffstat (limited to 'philo/include')
-rw-r--r--philo/include/philo.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/philo/include/philo.h b/philo/include/philo.h
index faf1bbf..b4db15b 100644
--- a/philo/include/philo.h
+++ b/philo/include/philo.h
@@ -6,7 +6,7 @@
/* By: dkaiser <dkaiser@student.42heilbronn.de +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/01/17 10:23:19 by dkaiser #+# #+# */
-/* Updated: 2025/01/18 13:12:06 by dkaiser ### ########.fr */
+/* Updated: 2025/01/18 16:57:23 by dkaiser ### ########.fr */
/* */
/* ************************************************************************** */
@@ -35,6 +35,8 @@ typedef struct s_phdata
int time_to_eat;
int time_to_sleep;
int times_must_eat;
+ int philos_must_eat;
+ pthread_mutex_t pme_mutex;
int simulation_running;
t_fork *forks;
} t_phdata;
@@ -43,7 +45,7 @@ typedef struct s_philo
{
int id;
int last_time_eaten;
- int times_eaten;
+ int times_must_eat;
int is_alive;
pthread_t thread;
t_phdata *data;