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();
};
our Sleeping Barber solution.