aboutsummaryrefslogtreecommitdiff
path: root/philo_one/src/routine.c
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_one/src/routine.c
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_one/src/routine.c')
-rw-r--r--philo_one/src/routine.c14
1 files changed, 7 insertions, 7 deletions
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);
}