/* chopsticks.h @(#)chopsticks.h 1.1 07 Jan 1994 chopstick management routines interface, for Dining Philosophers exercise Prepared for COP4610, Fall 1993 --Ted Baker Students are NOT to modify this file. */ extern void chopsticks_init(); /* call this once, before calling any of the following subprograms */ extern void chopsticks_take(int i); /* Call this once before "eating". The effect is to grab the chopsticks at positions i and (i+1)mod 5. The caller will block until both chopsticks are available, then take the two chopsticks. The two chopsticks are then not available for taking until they are released again. */ extern void chopsticks_put(int i); /* Call this once after "eating". The effect is to release the chopsticks at positions i and (i+1)mod 5. This should only be called by a thread that has previously called chopsticks_take(i), and which has not called chopsticks_put since then. */