aboutsummaryrefslogtreecommitdiff
path: root/philo_three/src/event.c
diff options
context:
space:
mode:
authorCharles Cabergs <me@cacharle.xyz>2021-01-03 16:58:00 +0100
committerCharles Cabergs <me@cacharle.xyz>2021-01-03 16:58:00 +0100
commit7e971b3fa805c40d02ac3e996ab1d181f9584866 (patch)
treef904b6f96e0080b86aadd4d9047f7dfb855c3a3d /philo_three/src/event.c
parente874ad94a31a8259b8eb7ad2865767c081bcd279 (diff)
downloadphilosophers-7e971b3fa805c40d02ac3e996ab1d181f9584866.tar.gz
philosophers-7e971b3fa805c40d02ac3e996ab1d181f9584866.tar.bz2
philosophers-7e971b3fa805c40d02ac3e996ab1d181f9584866.zip
Added h_sleep instead of usleep for better precision
Diffstat (limited to 'philo_three/src/event.c')
-rw-r--r--philo_three/src/event.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/philo_three/src/event.c b/philo_three/src/event.c
index 10f82c4..185147f 100644
--- a/philo_three/src/event.c
+++ b/philo_three/src/event.c
@@ -6,7 +6,7 @@
/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/02/14 21:37:50 by cacharle #+# #+# */
-/* Updated: 2021/01/03 13:51:20 by cacharle ### ########.fr */
+/* Updated: 2021/01/03 16:56:51 by cacharle ### ########.fr */
/* */
/* ************************************************************************** */
@@ -25,7 +25,7 @@ void event_eat(t_philo *philo)
sem_wait(philo->sem_stdout);
philo_put(philo->id, EVENT_EAT, philo->initial_time);
sem_post(philo->sem_stdout);
- usleep(philo->conf->timeout_eat * 1000);
+ h_sleep(philo->conf->timeout_eat);
}
void event_think(t_philo *philo)
@@ -42,7 +42,7 @@ void event_sleep(t_philo *philo)
sem_post(philo->sem_stdout);
sem_post(philo->forks);
sem_post(philo->forks);
- usleep(philo->conf->timeout_sleep * 1000);
+ h_sleep(philo->conf->timeout_sleep);
}
void event_die(t_philo *philo)