the forth homework Version 0 |
|
👤 Author: by x2014329620008 2016-11-08 18:49:01 |
bool cutChair=TRUE;
int waitChair=5,i=0;
void barber(){
while(true){
if(i==0)
sleep(cutChair=FALSE);
else
cutChair=TRUE;
}
}
void customer(){
while(true){
if(i>0&&i
i++;
sit();
}
if(i==waitChair)
leave();
if(i==0)
cutChair==TRUE;
sit();
}
}