From 99f67bde096ad84dad5b41bc779ae2ad2d807e6f Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Wed, 30 Sep 2020 10:35:23 +0200 Subject: Renaming io_* -> event_*, Changed philo_put with only 1 write call --- philo_one/src/routine.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'philo_one/src/routine.c') diff --git a/philo_one/src/routine.c b/philo_one/src/routine.c index 5f76a26..c1a7a4f 100644 --- a/philo_one/src/routine.c +++ b/philo_one/src/routine.c @@ -21,15 +21,15 @@ void *routine_philo(t_philo *arg) arg->time_last_eat = h_time_now(); if (pthread_create(&thread_death, NULL, (t_routine)routine_death, arg) != 0) return (NULL); - io_think(arg); + event_think(arg); while (arg->conf->all_alive) { - io_take_fork(arg, arg->fork_left); - io_take_fork(arg, arg->fork_right); + event_take_fork(arg, arg->fork_left); + event_take_fork(arg, arg->fork_right); arg->time_last_eat = h_time_now(); - io_eat(arg); - io_sleep(arg, arg->fork_right, arg->fork_left); - io_think(arg); + event_eat(arg); + event_sleep(arg, arg->fork_right, arg->fork_left); + event_think(arg); } pthread_join(thread_death, NULL); return (NULL); @@ -45,6 +45,6 @@ void *routine_death(t_philo *arg) current = h_time_now(); if (!arg->conf->all_alive) return (NULL); - io_die(arg); + event_die(arg); return (NULL); } -- cgit