nimp dans timestamp
This commit is contained in:
10
srcs/init.c
10
srcs/init.c
@@ -12,13 +12,13 @@ t_philo *lst_add_philo(t_params *params, t_global *global, int i)
|
||||
new->p_nbr = i + 1;
|
||||
if (pthread_mutex_init(&(new->m_fork), NULL) != 0)
|
||||
return (NULL);
|
||||
new->t_last_meal_s = 0;
|
||||
new->t_last_meal_u = 0;
|
||||
new->t_last_meal.ts = 0;
|
||||
new->t_last_meal.tu = 0;
|
||||
new->eat = 0;
|
||||
new->next = NULL;
|
||||
return (new);
|
||||
}
|
||||
|
||||
// looping chained list
|
||||
t_philo *init_chain_philo(t_params *params, t_global *global)
|
||||
{
|
||||
t_philo *philo;
|
||||
@@ -71,8 +71,8 @@ t_global *init_global(void)
|
||||
if (!global)
|
||||
return (NULL);
|
||||
global->dead = 0;
|
||||
global->t_start_s = 0;
|
||||
global->t_start_u = 0;
|
||||
global->t_start.ts = 0;
|
||||
global->t_start.tu = 0;
|
||||
if (pthread_mutex_init(&(global->m_print), NULL) != 0)
|
||||
return (NULL);
|
||||
if (pthread_mutex_init(&(global->m_dead), NULL) != 0)
|
||||
|
||||
Reference in New Issue
Block a user