试修改下面生产者一消费者问题解法中的错误。 producer; begin repeat producer an item in nextp; wait(mutex); wait(full); buffer(in):=nextp; signal(mutex); until false; end consumer: begin repeat wait(mutex); wait(empty); nextc:=buffer(out); out:=out+1; signal(mutex); consumer item in nextc; until false; end
【参考答案】
正确答案:producer; begin repeat producer an item in nextp; wait(......