Information Technology Reference
In-Depth Information
classBarberShop{
private:
Locklock;
CondwakeBarber;
CondnextCustomer;
booltimeToClose;
boolopen;
intarrivalCount;
intcutCount;
intfullCount;
public:
BarberShop();
~BarberShop(){};
voidbarberDay(); //Mainloopforbarberthread
boolgetHairCut(); //Calledbycustomerthread
voidclockRingsClosingTime(); //Calledbyclockthread
private:
voidopenStore();
intwaitForCustomer();
voiddoneCutting();
voidprintFinalStats();
boolemptyAndOpen();
boolstillNeedHaircut(intcustId);
boolwaitingRoomFull();
};
Figure5.16: BarberShop.h defines the interface and member variables for
our Sleeping Barber solution.
 
Search WWH ::




Custom Search