Procedure father:
begin
while(TRUE)
begin
P(S);
將水果放入盤中;
if(放入的是桔子)
V(So);
elseV(Sa);
end
end
Procedure son:
begin
while(TRUE)
begin
P(So);
從盤中取出桔子;
V(S);
吃桔子;
end
end
Procedure daughter:
begin
while(TRUE)
begin
P(Sa);
從盤中取出蘋果;
V(S);
吃蘋果;
end
end
返回《操作系統之PV金典》
[
From:http://tw.wingwit.com/Article/program/czxt/201311/24067.html