/*
 * Assignment 4 of Operating Systems: PThread simulation.
 * 
 * Sander van Veen (6167969) and Taddeus Kroes (6054129).
 * <sandervv@gmail.com>      and <taddeuskroes@hotmail.com>.
 * 
 * Submission date: 21 november 2010.
 */

typedef struct diner_stats {
    unsigned int meals;
    unsigned int forks;
    unsigned int id;
    unsigned int locked;
} diner_stats;

/*
 * Duration of the diner party (in seconds). When this time limit is reached,
 * all philosophers are requested to pay their bill and leave the party.
 */
#define TIME_LIMIT 10.f

int philo_left(diner_stats *stats, int id);
int philo_right(diner_stats *stats, int id);
int philo_optimistic(diner_stats *stats, int id);
int philo_shy(diner_stats *stats, int id);
int philo_random(diner_stats *stats, int id);

typedef int(*philo_t)(diner_stats *, int);
