Advertisement
Guest User

Untitled

a guest
Apr 19th, 2018
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.54 KB | None | 0 0
  1. void *philosophe_does(void *data)
  2. {
  3.         t_philo *current_philo = (t_philo *)data;
  4.         int count = current_philo->how_many_eat;
  5.         while (count != 0){
  6.                 if (current_philo->status == H_REST)
  7.                         count = take_decision(current_philo, count);
  8.                 else if (current_philo->status == H_THINK)
  9.                         count = eat(current_philo, count);
  10.                 else if (current_philo->status == H_EAT)
  11.                         rest(current_philo);
  12.         }
  13.         return (NULL);
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement