ALL > Computer and Education > courses > university courses > undergraduate courses > Operating System > CLASS (2016-2017-1)-62903-06102-1 > 2014329620008张昱 >
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();
}
}

Please login to reply. Login

Reversion History

Loading...
No reversions found.