aboutsummaryrefslogtreecommitdiff
path: root/philo/src/simulation.c
diff options
context:
space:
mode:
Diffstat (limited to 'philo/src/simulation.c')
-rw-r--r--philo/src/simulation.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/philo/src/simulation.c b/philo/src/simulation.c
index 9ae257e..53bb6f8 100644
--- a/philo/src/simulation.c
+++ b/philo/src/simulation.c
@@ -6,7 +6,7 @@
/* By: dkaiser <dkaiser@student.42heilbronn.de +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/01/17 14:38:04 by dkaiser #+# #+# */
-/* Updated: 2025/01/27 14:46:08 by dkaiser ### ########.fr */
+/* Updated: 2025/01/27 15:01:42 by dkaiser ### ########.fr */
/* */
/* ************************************************************************** */
@@ -84,14 +84,14 @@ int run_simulation(int nbr_of_philos, t_philo *philos, t_phdata *data)
break ;
i++;
}
+ if (result != EXIT_SUCCESS)
+ data->simulation_running = 0;
while (data->simulation_running)
{
if (data->philos_must_eat <= 0)
data->simulation_running = 0;
}
while (i--)
- {
pthread_join(philos[i].thread, NULL);
- }
return (result);
}