This change makes the main thread sleep for the time it would
take the "most hungry" philosopher to die. It is thus guaranteed
that no philosopher may die during the sleep.
/* By: ljiriste <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/03/05 12:49:40 by ljiriste #+# #+# */
-/* Updated: 2024/03/19 14:26:42 by ljiriste ### ########.fr */
+/* Updated: 2024/03/19 14:39:29 by ljiriste ### ########.fr */
/* */
/* ************************************************************************** */
return ;
}
now = cur_time_sus();
- //usleep(now - oldest);
+ usleep(set->time_to_die - (now - oldest));
}
}