/*
 * This is a simple philosopher, it probably doesn't work.
 *
 * Making use of the system calls semop(2), semget(2) and semctl(2)
 * might help though.
 * 
 * Name:
 * Email:
 *
 * Description of solution strategy:
 *
 */

#include <stdio.h>

extern int continuing[];
extern void think(int);
extern void eat(int);

/*
 * The philosopher method takes in an id which is this philosopher's id,
 * a unique opaque number among all philosophers.
 */
void philosopher(int id) {
  printf("I'm philosopher # %d\n", id);
  while(continuing[id]) {
    think(id);
    /* Need to do something to get two chopsticks */
    eat(id);
    /* Need to do something to put back two chopsticks */
  }
}
