fix: work with odd numbers of philos

This commit is contained in:
Camille Chauvet 2023-04-25 14:39:07 +00:00
parent d6aee63600
commit 891431c1be

View File

@ -87,7 +87,7 @@ void *philo_routine(void *arg)
philo = arg;
data = philo->data;
print_thinking(philo);
usleep((philo->id * (data->life_expectency / data->nb_philos)) * 1000);
usleep((philo->id % 2) * (data->eat_time) * 1000);
while (true)
{
if (check(philo, data))