200600814112 石强 计科071
{
if(p4->id==n)//头结点
{ all_q_head->all_q_next=p5->all_q_next; p5=p4=all_q_head->all_q_next;
}
else//非头节点
{
p4->all_q_next=p5->all_q_next;
p5=p4=all_q_head->all_q_next;
p5->flag=0;//标志位置零,释放此pcb结构
}
}
while(q1->id!=n&&q2->next!=NULL)//寻找id号为n的节点 {
q1=q2;
q2=q2->next; }
if(q2->id==n)//找到
{ if(q2->id==n)//头结点
{
ready_head->next=q2->next; q1=q2=ready_head->next; }
else//非头节点 { q1->next=q2->next;
q2=q1=ready_head->next;
q2->flag=0;//标志位置零,释放此pcb结构
}
} else
{ cout<<\没有你要撤销的进程!\
}
p4=p5=all_q_head->all_q_next;
if(p5==NULL)
{ cout<<\没有可以撤销的进程了!\ return;
}
//输出总链队列的内容
6
200600814112 石强 计科071
cout<<\进程撤销后总链队列的内容如下(进程id,进程名,优先级):\
while(p4!=NULL)
{ cout<
}//while
p4=all_q_head->all_q_next; //输出就绪队列的内容
cout<<\进程撤销后就绪队列的内容如下(进程id,进程名,优先级):\
while(q1!=NULL)
{cout<
q1=ready_head->next;
char g;
cout<<\你想继续撤销吗?(y/n):\ cin>>g;
if(g=='y'||g=='Y')continue; else if(g=='n'||g=='N')
{ cout<<\进程撤销完毕!\
return;
} else
{ cout<<\输入有误!\}}}
7