The P
begin
mutex:semaphore=
cobegin
process Scar//南邊來的車
begin
come;
p(mutex);
過橋;
v(mutex);
go;
end
process Ncar//北邊來的車
begin
come;
p(mutex);
過橋;
v(mutex);
go;
end
coend
end
返回《操作系統之PV金典》
[
From:http://tw.wingwit.com/Article/program/czxt/201311/24224.html