/* * ready(p) picks a new priority for a process and sticks it in the * runq for that priority. */ void ready(Proc *p) { int s, pri; Schedq *rq; void (*pt)(Proc*, int, vlong); if(p->state == Ready){ print("double ready %s %lud pc %p\n", p->text, p->pid, getcallerpc(&p)); return; } s = splhi(); if(edfready(p)){ splx(s); return; } if(up != p && (p->wired == nil || p->wired == MACHP(m->machno))) m->readied = p; /* group scheduling */ updatecpu(p); pri = reprioritize(p); p->priority = pri; rq = &runq[pri]; p->state = Ready; queueproc(rq, p); pt = proctrace; if(pt != nil) pt(p, SReady, 0); splx(s); }
/* * ready(p) picks a new priority for a process and sticks it in the * runq for that priority. */ void ready(Proc *p) { int s, pri; Schedq *rq; void (*pt)(Proc*, int, vlong); s = splhi(); if(edfready(p)){ splx(s); return; } if(up != p) m->readied = p; /* group scheduling */ updatecpu(p); pri = reprioritize(p); p->priority = pri; rq = &runq[pri]; p->state = Ready; queueproc(rq, p); pt = proctrace; if(pt) pt(p, SReady, 0); splx(s); }
static void schedready(Sched *sch, Proc *p, int locked) { Mpl pl; int pri; Schedq *rq; pl = splhi(); if(edfready(p)){ splx(pl); return; } /* if(m->externup != p) m->readied = p; *//* group scheduling, will be removed */ updatecpu(p); pri = reprioritize(p); p->priority = pri; rq = &sch->runq[pri]; p->state = Ready; queueproc(sch, rq, p, locked); if(p->trace) proctrace(p, SReady, 0); splx(pl); }
static void schedready(Sched *sch, Proc *p, int locked) { Mpl pl; int pri; Schedq *rq; pl = splhi(); if(edfready(p)){ splx(pl); return; } updatecpu(p); pri = reprioritize(p); p->priority = pri; rq = &sch->runq[pri]; p->state = Ready; queueproc(sch, rq, p, locked); if(p->trace) proctrace(p, SReady, 0); splx(pl); }