change name mtx_msg for m_print, malloc mutex instead of equal NULL, malloc id with pthread_t instead of int, and change name some functions
This commit is contained in:
@@ -24,11 +24,9 @@ void *philo_exec(void *arg)
|
||||
philo = (t_philo*)arg;
|
||||
nbr = philo->philo_nbr;
|
||||
|
||||
pthread_mutex_lock(philo->msg_mtx);
|
||||
// pthread_mutex_lock(&mutex);
|
||||
ft_printf("%i is thinking\n", philo->philo_nbr);
|
||||
pthread_mutex_unlock(philo->msg_mtx);
|
||||
// pthread_mutex_unlock(&mutex);
|
||||
pthread_mutex_lock(philo->m_print);
|
||||
ft_printf("%i is thinking\n", philo->philo_nbr);
|
||||
pthread_mutex_unlock(philo->m_print);
|
||||
|
||||
// eat
|
||||
// "has taken a fork"
|
||||
|
||||
Reference in New Issue
Block a user