This is implemented so that main checks well fed condition more
frequently. Without the well fed condition can be satisfied for a long
time before main notices, particularly for long time_to_death.
/* By: ljiriste <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/03/22 11:19:48 by ljiriste #+# #+# */
-/* Updated: 2024/09/05 11:32:29 by ljiriste ### ########.fr */
+/* Updated: 2024/09/05 11:43:30 by ljiriste ### ########.fr */
/* */
/* ************************************************************************** */
mutex_unlock(&diner->setting.end_lock);
return (well_fed);
}
- usleep(closest_death_time - usecs_since_start(diner->setting.start));
+ if (closest_death_time - usecs_since_start(diner->setting.start) > 100)
+ usleep(100);
}
}