void *thinkEatRepeat() { Thinking... pthread_mutex_lock(&chopsticks[i]); pthread_mutex_lock(&chopsticks[(i+1)%n]); Eating... pthread_mutex_unlock(&chopsticks[i]); pthread_mutex_unlock(&chopsticks[(i+1)%n]); Finished Eating... }