clean: norm
This commit is contained in:
15
threads.c
15
threads.c
@ -1,3 +1,15 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* threads.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: cchauvet <cchauvet@student.42angouleme.fr +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2023/04/27 11:33:45 by cchauvet #+# #+# */
|
||||
/* Updated: 2023/04/27 11:37:40 by cchauvet ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "philo.h"
|
||||
#include <pthread.h>
|
||||
#include <stdbool.h>
|
||||
@ -11,7 +23,8 @@ bool threads_init(t_data *data)
|
||||
i = 0;
|
||||
while (i < data->nb_philos)
|
||||
{
|
||||
if (pthread_create(&data->threads[i], NULL, philo_routine, data->philos[i]))
|
||||
if (pthread_create(&data->threads[i], NULL, philo_routine,
|
||||
data->philos[i]))
|
||||
return (true);
|
||||
pthread_detach(data->threads[i]);
|
||||
i++;
|
||||
|
||||
Reference in New Issue
Block a user