OBLFair_Table - int maxHunger; int numHungers; }...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
#ifndef _OBLFairTable_H_ #define _OBLFairTable_H_ #include "sthread.h" static const int NO_PHILOSOPHER = -1; typedef int CID; typedef struct chopStick{ CID cid; struct chopStick *nextStick; int holder; int dirty; int hunger; } chopStick; typedef struct OBLFairTable{ chopStick *baseStick; int lastStick; smutex_t *tabmutex; scond_t *tabcond; int plates; int dirtyplates; //concerning number of eaters int eaters; scond_t *noeaters; //concerning cleanliness scond_t *dirty; scond_t *clean; int cleanerReady; int busboyHasStuff; int busboyHasSomeStuff; int gotSticks; int gotPlates; int gotBowl; //bowl variables scond_t *bowlcond; int servings; int serverHasBowl; scond_t *bowlreturned; //concerning fairness
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: int maxHunger; int numHungers; } OBLFairTable; void OBLF_init(OBLFairTable *t, int nPlates); void OBLF_startEating(OBLFairTable *t, int philosopher); void OBLF_doneEating(OBLFairTable *t, int philosopher); void OBLF_takeEmptyBowl(OBLFairTable *t); void OBLF_returnRefilledBowl(OBLFairTable *t, int servingCount); void OBLF_waitUntilAllPlatesDirty(OBLFairTable *t); void OBLF_gatherSticks(OBLFairTable *t); void OBLF_gatherBowl(OBLFairTable *t); void OBLF_gatherPlates(OBLFairTable *t); void OBLF_returnSticks(OBLFairTable *t); void OBLF_returnBowl(OBLFairTable *t); void OBLF_returnPlates(OBLFairTable *t); #endif...
View Full Document

Page1 / 2

OBLFair_Table - int maxHunger; int numHungers; }...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online