aboutsummaryrefslogtreecommitdiff
path: root/philo_two/src/philo_two.h
diff options
context:
space:
mode:
authorCharles Cabergs <me@cacharle.xyz>2020-09-30 10:35:23 +0200
committerCharles Cabergs <me@cacharle.xyz>2020-09-30 10:35:23 +0200
commit99f67bde096ad84dad5b41bc779ae2ad2d807e6f (patch)
tree282a443477f4d81381a0aa526af1a0aefbf82ae3 /philo_two/src/philo_two.h
parent94d33564ee659d2fd0b084a4b4046e7b69ee0d9b (diff)
downloadphilosophers-99f67bde096ad84dad5b41bc779ae2ad2d807e6f.tar.gz
philosophers-99f67bde096ad84dad5b41bc779ae2ad2d807e6f.tar.bz2
philosophers-99f67bde096ad84dad5b41bc779ae2ad2d807e6f.zip
Renaming io_* -> event_*, Changed philo_put with only 1 write call
Diffstat (limited to 'philo_two/src/philo_two.h')
-rw-r--r--philo_two/src/philo_two.h23
1 files changed, 11 insertions, 12 deletions
diff --git a/philo_two/src/philo_two.h b/philo_two/src/philo_two.h
index 5318510..a697382 100644
--- a/philo_two/src/philo_two.h
+++ b/philo_two/src/philo_two.h
@@ -6,7 +6,7 @@
/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/02/14 22:47:23 by cacharle #+# #+# */
-/* Updated: 2020/09/30 08:41:15 by cacharle ### ########.fr */
+/* Updated: 2020/09/30 10:02:50 by cacharle ### ########.fr */
/* */
/* ************************************************************************** */
@@ -28,34 +28,33 @@ typedef struct
t_time timeout_sleep;
long int meal_num;
bool all_alive;
- pthread_mutex_t mutex_all_alive;
pthread_mutex_t mutex_stdout;
} t_philo_conf;
typedef struct
{
- int id;
+ long int id;
t_philo_conf *conf;
t_time time_last_eat;
sem_t *forks;
-} t_routine_arg;
+} t_philo;
/*
** routine.c
*/
-void *routine_philo(t_routine_arg *arg);
-void *routine_death(t_routine_arg *arg);
-t_routine_arg *routine_args_create(t_philo_conf *conf, sem_t *forks);
+void *routine_philo(t_philo *arg);
+void *routine_death(t_philo *arg);
+t_philo *routine_create_philos(t_philo_conf *conf, sem_t *forks);
/*
** io.c
*/
-void io_take_fork(t_routine_arg *arg);
-void io_eat(t_routine_arg *arg);
-void io_think(t_routine_arg *arg);
-void io_sleep(t_routine_arg *arg);
-void io_die(t_routine_arg *arg);
+void event_take_fork(t_philo *arg);
+void event_eat(t_philo *arg);
+void event_think(t_philo *arg);
+void event_sleep(t_philo *arg);
+void event_die(t_philo *arg);
#endif