Fix small bugs.
This commit is contained in:
parent
2f2df5e02e
commit
c4097c2951
14 changed files with 71 additions and 34 deletions
|
|
@ -171,7 +171,7 @@ needstack(int howmuch)
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
int
|
||||
_sched(void)
|
||||
{
|
||||
Proc *p;
|
||||
|
|
@ -186,8 +186,8 @@ Resched:
|
|||
// psstate(t->state), &t->sched, &p->sched);
|
||||
if(_setlabel(&t->sched)==0)
|
||||
_gotolabel(&p->sched);
|
||||
_threadstacklimit(t->stk);
|
||||
return;
|
||||
_threadstacklimit(t->stk, t->stk+t->stksize);
|
||||
return p->nsched++;
|
||||
}else{
|
||||
t = runthread(p);
|
||||
if(t == nil){
|
||||
|
|
@ -277,10 +277,15 @@ _threadidle(void)
|
|||
unlock(&p->readylock);
|
||||
}
|
||||
|
||||
void
|
||||
int
|
||||
yield(void)
|
||||
{
|
||||
_sched();
|
||||
Proc *p;
|
||||
int nsched;
|
||||
|
||||
p = _threadgetproc();
|
||||
nsched = p->nsched;
|
||||
return _sched() - nsched;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue