ALL > Computer and Education > courses > university courses > undergraduate courses > Operating System > CLASS (2016-2017-1)-62903-06102-1 > 2014329620080_薛丽爽 > Exercise-6.11 >
Exercise-6.11 Version 0
👤 Author: by lsxueout163com 2016-11-08 16:41:52
理发师:
do
{
Wait(Scuthair);                               //检查是否有顾客,无,就睡眠

}while(1);
顾客:
wait(Snumchair);                            //申请占用椅子

signal(Scuthair);                           //给理发师发一个信号

Semaphore Scuthair,Mutexchair;

int number=0;                                  //顾客的共享变量

Please login to reply. Login

Reversion History

Loading...
No reversions found.